How to change the base “/api” path on Azure Functions (v2)?

后端 未结 2 829
花落未央
花落未央 2021-01-18 15:32

In azure functions we create the function route / name, but it Always preceded by /api

on the documentation we read:

Note that you did not in

2条回答
  •  既然无缘
    2021-01-18 15:42

    Accepted answer does not work for v2 anymore (source: Azure-Functions-Host Gitub repo). For v2 you need to wrap http settings inside extensions object. Working host.json example:

    {
      "version": "2.0",
      "extensions": {
        "http": {
          "routePrefix": "customPrefix"
        }
      }
    }
    

提交回复
热议问题