NancyFX Routing issue

时间:2015-09-14 15:45:58

标签: .net nancy

I'm having weird routing issue with NancyFX

Public class BooModule : NancyModule
{
    public BooModule() : base("/boo")

    {
      Get["/foo"] = x => {...};  
    }
}

I use VS2013. If I debug and go to

http:/localhost/myProject/boo/foo

It goes into BooModule but doesn't invoke Foo method. I get empty response. I tried playing with slashes but that didn't help. Any ideas what's going on here? Thanks!

1 个答案:

答案 0 :(得分:0)

可能你必须从URI中删除myProject。

您是否已将Nancy.Hosting.Aspnet添加到项目中?

如果从VS2013运行,可能会在不同于80的端口上运行服务器

http:/localhost:PORT/boo/foo