Skip to content

A template project that Use NancyFx 1.4.4 version routing instead of regular MVC.

License

Notifications You must be signed in to change notification settings

zwcloud/NancyFxViaAspNetCore

Repository files navigation

NancyFx via ASP.NET Core

An ASP.NET Core 3.1 template project that uses NancyFx 1.4.4 routing instead of regular MVC.

Why

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.

Run

git clone https://github.com/zwcloud/NancyFxViaAspNetCore.git
cd .\NancyFxViaAspNetCore
dotnet run

Then in your webbrowser, input http://localhost:5000 and enter.

Usage

Usage

About

A template project that Use NancyFx 1.4.4 version routing instead of regular MVC.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published