In my code i have that route
const API_BASE_ROUTE =
process.env.REACT_APP_API_BASE_ROUTE || “http://localhost:5000/api”;
In Render environment i save key REACT_APP_API_BASE_ROUTE with value.
Also update my build command like in render doc REACT_APP_API_BASE_ROUTE=$API_BASE_ROUTE npm run build
What did i wrong here ??
Tahnks for the answers.
Hey, you can use it without process.env as well,unless it’s a commercial site… and i don’t think u need to use route var when with npm run build.
Just make sure all your routes with https://localhost:5000/api in code, are replaced with export const API_URL in a seperate file ; you will be able to import this in other files.