[英]How to set root path for static files in ServiceStack self-host
All of the ServiceStack self-host examples serve static files from the same directory as the console or service executable assembly. 所有ServiceStack自主机示例都提供与控制台或服务可执行程序集相同的目录中的静态文件。
Is there a way to change the rooth path to something else? 有没有办法将rooth路径改为其他东西?
When I set Config.WebHostPhysicalPath
to a different path from within AppHostHttpListenerBase.Configure
, my html file had to exist in both places for ServiceStack to return anything. 当我设置Config.WebHostPhysicalPath
从内部不同的路径AppHostHttpListenerBase.Configure
,我的HTML文件中有两个地方存在ServiceStack返回任何东西。
I was wondering the same thing so I dug into the SS source and found an issue that prevents the Config.WebHostPhysicalPath
from working with static files. 我想知道同样的事情所以我挖掘SS源并发现一个问题阻止Config.WebHostPhysicalPath
使用静态文件。 You can read about it here: https://github.com/ServiceStack/ServiceStack/issues/352 你可以在这里阅读: https : //github.com/ServiceStack/ServiceStack/issues/352
Update 2012-12-03 更新2012-12-03
My pull request for this issue has just been merged into ServiceStack/master. 我对此问题的拉取请求刚刚合并到ServiceStack / master中。 https://github.com/ServiceStack/ServiceStack/pull/357 https://github.com/ServiceStack/ServiceStack/pull/357
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.