Wednesday, March 7, 2012

NancyFx returns 404 for default route

NancyFx returns 404 for default route

I ran into an issue doing some preliminary coding using NancyFx.  I kept getting an 404 to the point where it seemed like the green guy was mocking me.  My code seemed simple:


   1:  public classMainModule : NancyModule
   2:      {
   3:          public MainModule()
   4:          {
   5:              Get["/"] = x =>;
   6:                             {
   7:                                 return View["home"];
   8:                             };
   9:          }
  10:      }


I tried adding a default override to my class (: base {"/"}), but I kept seeing this.
 

I checked stack exchange and read the documentation to no avail. I don't remember what made me think to try, but i decided to change my site to use IIS Express instead of the built-in web server and that fixed it.