Routing path with ServiceStack

2019-07-02 00:02发布

I'm using AngularJS, I want to do the following routing on ServiceStack-serving-static-html

enter image description here

Note the intercept any path on the screenshot.

Also note I'm not using ServiceStack for REST, I'm using it as pure webserver for serving static contents, e.g. html

Is it possible to do that on ServiceStack?

1条回答
ら.Afraid
2楼-- · 2019-07-02 00:55

This is node.js code, you haven't shown any C# ServiceStack AppHost code here.

ServiceStack by default supports serving of static content via HTTP, although to serve static content from the root directory of your app you should host it at /.

You've not mentioned whether you're using hosting ServiceStack via ASP.NET host or as a stand-alone self-hosting HttpListener. If it's the latter you also need to, in VS.NET set your files you want to mark the Build Action of your static files as Content and set it's Copy to Output Directory as Copy if Newer.

查看更多
登录 后发表回答