NancyFxViaAspNetCore
1.0.0
Ein ASP.NET Core 3.1 -Template -Projekt, das NancyFX 1.4.4 anstelle von regulärem MVC verwendet.
Ich war vor V1.4.4 in Nancyfx gewachsen:
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 ) ;
} ;
}
}Da NancyFX jedoch eingestellt wurde, habe ich mich entschieden, stattdessen ein ähnliches Routing im ASP.NET -Kern zu implementieren.
git clone https://github.com/zwcloud/NancyFxViaAspNetCore.git
cd .NancyFxViaAspNetCore
dotnet run Geben Sie dann in Ihrem Webbrowser http://localhost:5000 ein und geben Sie ein.