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

122
Views
Replace URL during build step of npm

I've a mock REST service during development and a real backend I want to use for the public release. Is there a way to replace the endpoint URL somehow during the npm build step?

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

0

You can use process.env.NODE_ENV to measure whether it is at development environment or production environment.

It would be something like this:

const baseUrl = process.env.NODE_ENV === 'development' ? 'localhost:3000' : 'www.live.com'

localhost:3000 would be the backend url while you developing.

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!