asp.net-core - Host Asp.net Core Web Api locally
问题描述
I am learning Asp.net Core Web Api. I need to access the api from a flutter application but am not ready to host the api on Azure. What are my options if I want to host the api locally on my computer so I can access it from another application like my Flutter app client, and is there any tutorials I can follow to learn how to implement the solution.
解决方案
There are several ways to go about this, here are some options:
FROM VISUAL STUDIO: You can simply run the ASP.NET Core Web API from Visual Studio in Development Mode by Pressing F5
FROM COMMAND PROMPT: Run the API Project from the command line by opening a command prompt window in the root project folder of the project and use the dotnet run command. See here for more info about the command: dotner run command
HOSTING IN IIS: I am assuming you are running a windows OS. You can turn on IIS and its features. Simply follow the instructions on this page: Host ASP.NET Core in IIS on how to deploy ASP.NET Core to IIS. The advantage of this is that you have the application always running while you work on your flutter application locally.
I hope this helps you resolve your situation.
推荐阅读
- javascript - 如何从 html 按钮更改 javascript 布尔值?
- javascript - 更改的文本文件,像幻灯片一样显示?
- c - 当您在函数中分配内存时,它会在您返回时自动释放吗?
- javascript - C# 与 JavaScript(或 TypeScript)中的异步“任务”结果代码流
- c# - 字符串的长度不是我所期望的
- f# - F# 中的动作委托
- python - 是否可以将“im2col”和“col2im”扩展到 ND 图像?
- ruby-on-rails - 如何与具有子域约束的根匹配
- arm - STDOUT 与 GDB、OopenOCD 和半主机有什么关系?
- ios - NFC iOS:无通知读取 NFC 标签