5

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

1 Answer 1

7

Yes, there is a possibility. but we need to flow some steps to achieve this.

  1. we should use OwinSelfHost package for self hosting.
  2. we should create as class file that inherits from ApiController.
  3. 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.

Reference Example

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks rock star, do the service keep on running ? will performance matters compared to webApi project

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.