I've scrapped what I was working with and went to the simplest of code:
class Program
{
    static void Main(string[] args)
    {
        var nancyHost = new Nancy.Hosting.Self.NancyHost(new   Uri("http://localhost:8080"));
        nancyHost.Start();
        Console.ReadLine();
        nancyHost.Stop();
    }
}
public class MainModule : Nancy.NancyModule
{
    public MainModule()
    {
        Get["/"] = x =>
        {
            return "Hello world!";
        };
    }
}
When I browse to
   http://localhost:8080
I get:
Service Unavailable
HTTP Error 503. The service is unavailable.
I've tried several solutions. Including several variations on: Remote access to a Nancy Self Host
Any ideas?
Make sure you are running Visual Studio as Administrator and that 8080 is not used by something else at the same time. Have a look at the self-hosting demo which sets up a couple of different URIs for a self-hosted application https://github.com/NancyFx/Nancy/blob/master/src/Nancy.Demo.Hosting.Self/Program.cs#L12
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