为 Azure Functions 本地主机配置 CORS [英] Configure CORS for Azure Functions Local Host

查看:19
本文介绍了为 Azure Functions 本地主机配置 CORS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Azure Functions CLI 工具在本地测试 Azure Functions 应用.有什么方法可以为本地主机配置 CORS 设置?

I'm testing an Azure Functions app locally with the Azure Functions CLI tooling. Is there any way I can configure CORS settings for the local host?

推荐答案

可以这样启动主机

func host start --cors *

您还可以更具体,并提供一个逗号分隔的允许 url 列表

You can also be more specific and provide a comma delimited list of allowed urls

更多:https://github.com/Azure/azure-webjobs-sdk-script/issues/1012

这篇关于为 Azure Functions 本地主机配置 CORS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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