示例#1
0
文件: Owin.cs 项目: voltagex/junkcode
        public void Configuration(IAppBuilder app)
        {
            HttpConfiguration config = new HttpConfiguration();
            config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
            config.EnableSystemDiagnosticsTracing();

            config.Formatters.Clear();
            config.Formatters.Add(new ServiceStackTextFormatter());
            config.EnableCors();

            app.MapStatic("/ui", "ui");
            app.MapStatic("/scripts", "scripts");
            app.MapStatic("/bower_components", "bower_components");

            app.Use<RedirectMiddleware>();
            config.MapHttpAttributeRoutes();

            app.UseWebApi(config);
        }
示例#2
0
 public void Configuration(IAppBuilder appBuilder)
 {
     appBuilder.MapStatic("/content")
               .UseStatic(ContentPath("Index.html"))
               .MapStatic("/css", ContentPath("css"))
               .MapStatic("/js", ContentPath("js"))
               .MapStatic("/font-awesome", ContentPath("font-awesome"))
               .UseStatic(new StaticSettings("..\\..\\Content\\"){Cached = true})
               .UseErrorPage();
 }