路由路径与ServiceStack [英] Routing path with ServiceStack

查看:550
本文介绍了路由路径与ServiceStack的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用AngularJS,我想对以下路由ServiceStack - 服 - 静态HTML

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

请注意在拦截的截图任何路径

另外请注意,我没有使用REST ServiceStack,我用它作为纯Web服务器提供静态内容,例如HTML

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

是否有可能做到这一点的ServiceStack?

Is it possible to do that on ServiceStack?

推荐答案

这是Node.js的code,你有没有表现出任何C#ServiceStack APPHOST code在这里。

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

ServiceStack由在职的通过HTTP静态内容默认支持,尽管从根目录提供静态内容您的应用程序,你应该在 / 承载它。

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 /.

不管你是通过ASP.NET主机或使用托管ServiceStack你没有提到独立自托管的HttpListener。如果是后者,你还需要在VS.NET设置你的文件,你想标记生成操作您的静态文件的内容并设置它的复制到输出目录复制如果较新的

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.

这篇关于路由路径与ServiceStack的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆