Answers for "react open on different url instead of localhost"

0

react open on different url instead of localhost

As well as changing your /etc/hosts as advised above, if you want CRA to know about the new host name, the HOST env var should give you what you want.

E.g. (this can go into your package.json under scripts/start)

HOST=somedomain.com react-scripts start
That should start your CRA-based dev server, listening at that domain name, and it should open/refresh a browser tab pointing there.

Edit: docs on this and other env vars that CRA uses.
Posted by: Guest on August-31-2020

Code answers related to "react open on different url instead of localhost"

Code answers related to "Javascript"

Browse Popular Code Answers by Language