I set environment variables in the azure app service through the settings
and I want to change to the environment variable I created through the code How can it be accessed? something like this
app.listen(PORT, () => {
console.log(`Example app listening at http://localhost:${config.PORT}`)
});
but it not recognizes the variable PORT
Similarly how you access environment variables in your local environment, You need to use process.env.ENV_VARIABLE
to read environment variables in Node .
var port = process.env.PORT;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.