Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1K
Views
How do I change localhost:3000 to custom.domain in react
 "scripts": {
    "start": "cross-env NODE_PATH=src react-scripts start",
    "build": "cross-env NODE_PATH=src react-scripts build",
  }

How do I change localhost:3000 to custom.domain in react

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

You can't change localhost to mydomain.com in local development. Your react app is available in your own browser thanks to a local dev server powered by Webpack (it's made under the hood of your Create React App).

If you want a custom domain, you will need to host your code on a server. The server will have an IP address. You can then attach a custom domain name to it through any provider.

When a user tries to access your website, he will send a request to a DNS server, that will find the correct IP bound to your custom domain name and then send him back the code to display your website.

about 4 years ago · Juan Pablo Isaza Report

0

If you are asking about purely locally serving your application you can simply append a HOST value before the script. Much like others have pointed out you can do with a PORT value.

"scripts": {
  "start": "HOST=custom.domain react-scripts start"
}

Then on your machine you will just need to ensure that you have configured your hosts files with the appropriate directive

127.0.0.1 custom.domain

Assuming you have run the start script and are serving the site you can now access it via the url http://custom.domain:3000

about 4 years ago · Juan Pablo Isaza Report

0

If you want to change domain you need to upload your react app to web space. If you want to change port you need to send argument in start script.

"scripts": {
    "start": "set port=4213 && react-scripts start",
}

In this case port will be 4213. So site will run on http://localhost:4213

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!