2

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.com/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.

markreyes
  • 1,249
  • 1
  • 13
  • 27

1 Answers1

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.com/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

Community
  • 1
  • 1
Cisco
  • 20,972
  • 5
  • 38
  • 60
  • 1
    I know it has nothing to do with the process object. But in their usage section it illustrates an if check that leads me to that very object. Hence my inquiry. Thanks for dropping some insight. I'll see if helps connect the dots. – markreyes Jul 24 '18 at 17:17
  • Where in `norobot` docs do you see any mention of `process`? https://github.com/sbtoledo/norobot/blob/master/README.md – Cisco Jul 24 '18 at 17:23
  • 1
    After the last single-line comment "// If not in production, enable X-Robots-Tag for entire application", !== process.env.NODE_ENV – markreyes Jul 24 '18 at 17:25