我们如何使用 Azure 后端 Node.js 访问 Azure 应用服务中的应用设置?
以前在 Azure 移动服务中,我们可以使用:
require('mobileservice-config');
但这不再有效。
最佳答案
这里是 MSDN 上与您情况相同的线程,地址为 https://social.msdn.microsoft.com/Forums/azure/en-US/1052696e-f37a-4946-a833-5e3912ac3ab8/nodejs-get-app-settings?forum=azuremobile 。
Any settings or connection strings defined in the Azure portal or through environment settings are available on the
process.env
variable. Many of these are normalized into the mobile app configuration object (exposed throughreq.azureMobile.configuration
), but if you've added any custom settings, useprocess.env
.
EG
var appSettings = process.env
关于node.js - Azure 应用服务 Node.js 后端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39386898/