如何从 Azure 函数 url 中删除单词“api" [英] How to remove the word ‘api’ from Azure functions url

查看:9
本文介绍了如何从 Azure 函数 url 中删除单词“api"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你创建一个 Http 触发的 API 时,Azure 函数会托管它

When you create an Http triggered API, Azure function hosts it on

https://[function-app-name].azurewebsites.net/api/[Route-configured-in-application]

有什么办法可以去掉 URL 中的 api 一词,让它看起来像:

Is there any way of getting rid of the term api from the URL and make it look like:

https://[function-app-name].azurewebsites.net/[Route-configured-in-application]

推荐答案

编辑host.json文件,设置routePrefix为空字符串:

Edit the host.json file and set routePrefix to empty string:

{
  "http": {
    "routePrefix": ""
  }
}

这篇关于如何从 Azure 函数 url 中删除单词“api"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆