Question

I am trying to create a really simple NancyFx project using OWIN hosting.

Nancy appears to be running because I get the 404 that comes with Nancy by default, but none of my modules are ever reached.

Here is what I have so far. It is probably something really obvious.

Startup.cs

public class Startup
{
    public void Configuration(IAppBuilder builder)
    {
        builder.UseNancy();
    }
}

Program.cs

class Program
{
    static void Main(string[] args)
    {
        using (WebApplication.Start<Startup>("http://+:8080"))
        {
            Console.WriteLine("Press enter to exit");
            Console.ReadLine();
        }
    }
}

HelloWorld.cs

class HelloWorld : Nancy.NancyModule
{
    public HelloWorld()
    {
        Get["/"] = parameters =>
        {
            return "Hello World!";
        };
    }
}

Thanks for the help in advance!

Was it helpful?

Solution

You need to make your module public, right now it's private

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top