Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NancyFx not reaching module using Owin Hosting

Tags:

owin

nancy

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!

like image 510
Alex Avatar asked Apr 29 '13 04:04

Alex


1 Answers

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

like image 96
TheCodeJunkie Avatar answered Sep 30 '22 14:09

TheCodeJunkie