NancyFX Catch All route

后端 未结 4 1152
迷失自我
迷失自我 2021-02-19 02:38

Does NancyFX supports ASP.NET MVC like \'Catch All\' route? I need one, that basically match every URL. This is very handy for building up Single Page applications.

Is t

4条回答
  •  情深已故
    2021-02-19 02:53

    An updated answer for whom @synhershko 's solution does not work. Try:

    Get[@"^(.*)$"] = parameters => {
        return "hi";
    };
    

    This will capture all paths except for the index page. I am not sure if this will work in the context of Angular, but this worked for me when trying to hack together a simple server with just one handler.

提交回复
热议问题