Is it possible to serve a web page from a self hos

2019-05-01 15:33发布

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?

1条回答
够拽才男人
2楼-- · 2019-05-01 15:56

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

查看更多
登录 后发表回答