0
사용자 지정 루트 경로의 구성은 꽤 곧장 앞으로 보인다 같은 https://github.com/NancyFx/Nancy/wiki/The-root-path낸시 - 사용자 지정 루트 경로 - 셀프 호스팅 - 모노/리눅스
내 부트 스트 래퍼와 루트 경로 제공 모양 :
using System;
using Nancy;
using Nancy.TinyIoc;
namespace Marquee.WebUI
{
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines) {
base.ApplicationStartup(container, pipelines);
StaticConfiguration.DisableErrorTraces = false;
}
protected override IRootPathProvider RootPathProvider {
get { return new CustomRootPathProvider(); }
}
}
using System;
using Nancy;
namespace Marquee.WebUI
{
public class CustomRootPathProvider : IRootPathProvider
{
private readonly string _rootPath = System.Environment.CurrentDirectory;
public string GetRootPath() {
return _rootPath;
}
}
}
내 리소스는 모두 포스트 빌드가 필요한 곳입니다. {System.Environment.CurrentDirectory} /css/bootstrap.min.css, 나는 CustomRootPathProvider가 호출되고 있다는 것을 확인하기 위해 시작을 디버깅했지만 아직 http : // {localhost}에 대해 404를 얻었습니다 : 1234/css/bootstrap.min .css