-
Notifications
You must be signed in to change notification settings - Fork 0
Self Hosting Nancy
You can use a console app to host Nancy. Simply install the Nancy.Hosting.Self NuGet package and use the code below to host Nancy.
var nancyHost = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:1234"));
nancyHost.Start();
Console.ReadLine();
nancyHost.Stop();
You can then define your Modules etc and they will get hit as expected.
Note that on Windows hosts a HttpListenerException may be thrown with an Access Denied message. To resolve this the URL has to be added to the ACL.
On Windows Vista/Server 2008 or later, execute the following in PowerShell or CMD running as administrator:
netsh http add urlacl url=http://+:1234/ user=DOMAIN\username
Replace DOMAIN\username with your domain and username or your computer name and username if you are not joined to a domain. See http://msdn.microsoft.com/en-us/library/ms733768.aspx for more information.
Also but the port may need to be opened on the machine or corporate firewall to allow access to the service.
- Taking a look at the DynamicDictionary
- The before and after module hooks
- Model binding
- Bootstrapper
- View Engines
- View location conventions
- Testing your application
- The root path
- Managing static content
- Diagnostics
- Adding a custom FavIcon
- The Application Before, After and OnError pipelines
- Generating a custom error page
- The cryptography helpers
- Content negotiation
- Authentication
- More to come
- Hosting Nancy with ASP.NET
- Hosting Nancy with WCF
- Hosting Nancy with Azure
- Hosting Nancy with OWIN
- Hosting Nancy with Umbraco
- Hosting Nancy with Nginx on Ubuntu
- Self Hosting Nancy
- Implementing a Host
- Accessing the client certificate when using SSL
- Blog Posts, Video & Audio
- Async-Beta (Async Beta)