I have seen many articles in Internet to create a RESTful Web API by selecting the WebAPI project as project type. Is there any possibility that we can create the same using console application. If possible, how can it be hosted? How does an executable file gives us the URL to consume from the client application?
1 Answer
Yes, there is a possibility. but we need to flow some steps to achieve this.
- we should use OwinSelfHost package for self hosting.
- we should create as class file that inherits from ApiController.
- install cors package for webapi application that is used for client to consume the application.
Hosting: domain name or IP should be given where the service is hosted.
1 Comment
Venki
Thanks rock star, do the service keep on running ? will performance matters compared to webApi project