An ASP.NET Core 3.1 template project that uses NancyFx 1.4.4 routing instead of regular MVC.
I'd grown to like routing in NancyFx before v1.4.4:
public class SampleModule : Nancy.NancyModule
{
public SampleModule()
{
Get["/"] = _ => "Hello World!";
Get["/home/"]= _ =>
{
return View["Home/Index"];
};
Get["/project/{name}"]= p =>
{
return View["Project/" + p.name];
};
Get["blog/{id}"]= p =>
{
Blog blog = GetBlog(p.id);
return Response.AsJson(blog);
};
}
}
But since NancyFx has been discontinued, I decided to implement similar routing inside ASP.NET Core instead.
git clone https://github.com/zwcloud/NancyFxViaAspNetCore.git
cd .\NancyFxViaAspNetCore
dotnet run
Then in your webbrowser, input http://localhost:5000
and enter.