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

查看:82
本文介绍了如何从Azure函数网址中删除单词"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]

有什么方法可以摆脱网址中的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函数网址中删除单词"api"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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