I define Nancy class like this:
public class DefNancy : NancyModule
{
public DefNancy() : base("/nancy") {
Get["/"] = _ => {
var model = new { title = "Hello world" };
return View["home", model];
};
}
}
And in OWIN Startup class:
public class Startup
{
public void Configuration(IAppBuilder app)
{
var hubConfiguration = new HubConfiguration();
hubConfiguration.EnableDetailedErrors = true;
app.MapSignalR(hubConfiguration);
config = new HttpConfiguration();
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute("def","api/{Controller}");
config.Formatters.Remove(config.Formatters.XmlFormatter);
app.UseWebApi(config);
app.UseNancy();
}
}
But now my *.aspx and another pages return 404 Error.
Use this:
app.UseNancy(options =>
options.PerformPassThrough = context =>
context.Response.StatusCode == HttpStatusCode.NotFound);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With