最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Where is process.env.NODE_ENV in Azure App Service - Stack Overflow

programmeradmin2浏览0评论

I'm using ExpressJS to connect the dots between NodeJS and my Angular app. I wanted to install this npm package norobot: to leverage the process object.

I'd like to know where/how to set the NODE_ENV in an App Service within Microsoft Azure.

I was pointed here,

But the current-day Azure portal looks significantly different versus what the documentation has supplied, leading me to a big disconnect.

If you could point me in the right direction, that'd be appreciated.

Additional FYI, At run-time, my stack is running on Node.js 9.4.

I'm using ExpressJS to connect the dots between NodeJS and my Angular app. I wanted to install this npm package norobot: to leverage the process object.

I'd like to know where/how to set the NODE_ENV in an App Service within Microsoft Azure.

I was pointed here, https://learn.microsoft./en-us/azure/app-service/web-sites-configure#howtochangeconfig

But the current-day Azure portal looks significantly different versus what the documentation has supplied, leading me to a big disconnect.

If you could point me in the right direction, that'd be appreciated.

Additional FYI, At run-time, my stack is running on Node.js 9.4.

Share Improve this question asked Jul 24, 2018 at 16:53 markreyesmarkreyes 1,2891 gold badge15 silver badges27 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 1

I wanted to install this npm package norobot: to leverage the process object.

norobot package has absolutely nothing to do with process.

But the current-day Azure portal looks significantly different versus what the documentation has supplied, leading me to a big disconnect.

Looks really shouldn't matter (to an extent), they serve as a visual guide.

The key section of the guide/docs you posted is App Settings:

This section contains name/value pairs that your web app will load on start up.

  • PHP, Python, Java and Node applications can access these settings as environment variables at runtime. For each app setting, two environment variables are created; one with the name specified by the app setting entry, and another with a prefix of APPSETTING_. Both contain the same value.

So following a similar answer: https://stackoverflow./a/34622196/2382650

set: NODE_ENV: some_value as shown above and it will be availble in your Express app as process.env.NODE_ENV

the environment variables in App Service need to be manually added under the "Application Settings" page:

发布评论

评论列表(0)

  1. 暂无评论