I have been requested to do an app that communicates with another app, i am requested to open my app in the url: js-api.local.dev as this url is used for connecting my app with the other one, they communicate between each other , how can i make this possible?
Asked
Active
Viewed 179 times
-2
-
What about chaning your `hosts` file to map `127.0.0.1` to `js-api.local.dev`? – r3dst0rm Apr 03 '19 at 09:26
-
I tried to do so but the app still opens in localhost – rrorrolfo Apr 03 '19 at 09:52
1 Answers
0
Chrome and Firefox force .dev domains to HTTPS via preloaded HSTS and maybe other browsers do the same thing
so you should use another tld sush as .test
or .localhsot
or you can try other solutions (e.g. https with self-signed certificates).
If you want to open your app with js-api.local.test for example:
- Add
127.0.0.1 js-api.local.test
to your hosts file - create a
.env
file in the root of your cra app and add:HOST=js-api.local.test
More info:
Chrome redirects .dev to https
How to stop Chrome from redirecting to HTTPS?
Chrome & Firefox now force .dev domains to HTTPS via preloaded HSTS
Create React App - Advanced Configuration

Fraction
- 11,668
- 5
- 28
- 48