简体   繁体   中英

Configure Azure to run nodejs app in development environment

NodeJS applications on Azure portal are running by default in production environment ( process.env.NODE_ENV is production).

Is it possible to change the environment to development ? And how?

(If it matters, I configured the application as a Web Site on Azure.)

You can set the NODE_ENV variable under the Website App settings configuration on the portal: http://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/#howtochangeconfig

Additionally, if you are using the Azure CLI (which you can install via npm install azure-cli -g ), you can run the following azure site config add NODE_ENV=development assuming your CLI is configured.

This will ask you for the website name then set the config.

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