简体   繁体   中英

Access to azure app setting environment variables from nodejs

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM