https://stackoverflow.com/questions/47164330/axios-api-calls-in-heroku/47165888
baseUrl = process.env.baseURL || "http://localhost:5000"
Even more stable way
https://stackoverflow.com/questions/52129849/how-to-get-the-base-url-variable-on-a-deployed-heroku-node-app
const production = 'https://examplePage.com';
const development = 'http://localhost:3000/';
const url = (process.env.NODE_ENV ? production : development);
process.env.NODE_ENV will resolve to undefined if you are running on localhost production mode.
and return production if you have deployed the app production mode.
baseUrl = process.env.baseURL || "http://localhost:5000"
Even more stable way
https://stackoverflow.com/questions/52129849/how-to-get-the-base-url-variable-on-a-deployed-heroku-node-app
const production = 'https://examplePage.com';
const development = 'http://localhost:3000/';
const url = (process.env.NODE_ENV ? production : development);
process.env.NODE_ENV will resolve to undefined if you are running on localhost production mode.
and return production if you have deployed the app production mode.
댓글
댓글 쓰기