Last active
April 22, 2018 02:22
-
-
Save DevEarley/d817b05b9c7e0f899607272f0a5ff222 to your computer and use it in GitHub Desktop.
Nancy bootstrapper with a default web folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Nancy; | |
using Nancy.Bootstrapper; | |
using Nancy.TinyIoc; | |
using Nancy.Conventions; | |
using Nancy.Session; | |
namespace SomeApi | |
{ | |
public class Bootstrapper : DefaultNancyBootstrapper | |
{ | |
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines) | |
{ | |
base.ApplicationStartup(container, pipelines); | |
CookieBasedSessions.Enable(pipelines); | |
} | |
protected override void ConfigureConventions(NancyConventions nancyConventions) | |
{ | |
nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("/", "App_Data/Web")); | |
base.ConfigureConventions(nancyConventions); | |
} | |
} | |
} | |
/* | |
<system.web> | |
<compilation debug="true" targetFramework="4.0" /> | |
<httpHandlers> | |
<add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*"/> | |
</httpHandlers> | |
</system.web> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment