Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to serve a web page from a self hosted web API in a windows service?

I have a perfectly normal (TopShelf hosted) windows service. I have a requirement for a simple interface to the service which will return some current stats (held in memory).

I had a cunning plan to self-host a website within the service, and I see that the asp.net API has a self host functionality.

Is it possible to subvert the 'API'ness of the system and have it return simple (though not static) HTML that a browser could read directly?

If not that are there any other options or ideas for this scenario?

like image 751
Loofer Avatar asked Oct 04 '22 15:10

Loofer


1 Answers

Yes. This test site http://www.hypermediaapi.com is done using self-hosted WebAPI. The source for it is here https://github.com/darrelmiller/HypermediaApiSite

like image 75
Darrel Miller Avatar answered Oct 12 '22 11:10

Darrel Miller