Routing path with ServiceStack

强颜欢笑 提交于 2019-12-12 13:19:19

问题


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

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:


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.



来源:https://stackoverflow.com/questions/14718808/routing-path-with-servicestack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!