【问题标题】:NodeJs Azure function request/response local variablesNodeJs Azure 函数请求/响应局部变量
【发布时间】:2021-09-10 14:03:18
【问题描述】:

尝试在 Azure Function NodeJs 项目中查找可以保存请求/响应级别变量的对象。

类似于 expressjs 中的 res.locals http://expressjs.com/en/5x/api.html#res.locals

请建议是否有任何其他方式可以让我使用 azure 函数在每次执行时使用局部变量。

【问题讨论】:

    标签: node.js azure express azure-functions


    【解决方案1】:

    谢谢Cloud SME。发布您的建议作为帮助其他社区成员的答案。

    如果您在函数应用的根目录中使用local.settings.json 文件:

    {
      "IsEncrypted": false,
      "Values": {
        "AzureWebJobsStorage": "",
        "FUNCTIONS_WORKER_RUNTIME": "node",
        "translatorTextEndPoint": "https://api.cognitive.microsofttranslator.com/",
        "translatorTextKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "languageWorkers__node__arguments": "--prof"
      }
    }
    

    您可以参考Azure Functions JavaScript Local Development Environment VariablesAzure Functions JavaScript local development environmentDeploy Azure Funtions with Environment variables - Nodejs

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-03
    • 1970-01-01
    • 1970-01-01
    • 2020-10-11
    • 1970-01-01
    • 1970-01-01
    • 2019-06-22
    • 1970-01-01
    相关资源
    最近更新 更多