Contents
How to host web API REST service in IIS 10?
Now, let’s start hosting Web API REST Service in IIS 10. Before hosting any application, make sure that IIS (Internet Information Services) is installed on your Hosting Server. If it is not installed or enabled, then follow the below steps. Click on Windows icon at the bottom left corner and find the “Control Panel” menu and click on it.
How to deploy ASP.NET Web API on IIS?
In the .Net Framework version, choose ‘No managed code’, then leave the last option as-is, and press Ok. You should be able to see your newly created application pool listed in the application pools panel. Since we have the application pool ready, now we need to create a new website under IIS Sites.
How to add a website to IIS server?
Right click on “Site” in IIS and click on add new website, as shown in the following screenshot. After clicking on “Add Website” option, it displays the following configuration window. I hope you understood the preceding configuration by highlighted text. Define the site name which will be useful to uniquely identify the site within the IIS Server.
How to host ASP.NET MVC application on IIS?
Choose the protocol for your application i.e HTTP or HTTPS which requires port 443 to be open and choose the Host name which will be used publicly to access the application. After defining all the configurations, the web site configuration window will look like this. Now, click on OK button.
How to self host a web API with.net?
Take your existing application and adding a NuGet reference for Microsoft.AspNet.WebApi.SelfHost. This library will be used to host the HTTP endpoint within our application. This is pretty basic when using the code Microsoft has provided.
How to browse web application using REST client?
Browse the hosted application using REST client with base URL along with API, Controller name, and Action method name, with pattern defined in routing template inside the webapiconfig.cs file. We can browse applications using the browser but then, we can only test the GET method.
How to simplify.net REST API development?
The static content handling and compression in IIS may be impressive, but irrelevant. Process recovery can be taken care of by running the executable as a service with a service manager like NSSM. Other features such as monitoring and logging should arguably be application-level concerns.