已发布的Blazor WebAssembly应用程序将API调用重定向到页面,而不是API控制器
我有一个带有客户端和服务器项目的Blazor WASM应用程序。客户端通过使用api-call获取是从服务器中获取的数据。但是,当我将应用程序发布到Azure时,它不起作用。
在Visual Studio中运行: https:// localhost:{number}/api/project/getall返回预期的JSON。
发表于Azure: https:// {website} .azurewebsites.net/api/project/getall返回index.html的内容,
我认为这与路由有关,但我无法弄清楚。
注意:当我在Release-Modus(以Azure中的数据库访问数据库)中运行该项目时,它可以按预期工作。
感谢您的帮助!
I have a Blazor Wasm application with a Client and a Server project. The Client gets is data from the Server by using an api-call. However, when I publish the application to Azure it doesnt work.
Running in Visual Studio:
https://localhost:{number}/api/Project/GetAll returns the expected json.
Published in Azure:
https://{website}.azurewebsites.net/api/Project/GetAll returns the content of the index.html
I think it has something to do with routing but I cannot figure it out.
Note: when I run the project in Release-modus (which accesses the database in Azure) it works as expected.
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论