NancyFX Catch All route

后端 未结 4 1137
迷失自我
迷失自我 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:52

    Yes, using Regex

    Get[@"/(.*)"] = parameters => {
        return View["viewname", parameters];
    };
    

    But you don't really need it for building a Single Page Application with NancyFX - you can just use Get and Post with all your routing logic and still have a single page app.

提交回复
热议问题