NancyFxViaAspNetCore
1.0.0
通常のMVCの代わりにNancyFX 1.4.4ルーティングを使用するASP.NETコア3.1テンプレートプロジェクト。
私は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 ) ;
} ;
}
}しかし、NancyFXは中止されているため、代わりにASP.NETコア内に同様のルーティングを実装することにしました。
git clone https://github.com/zwcloud/NancyFxViaAspNetCore.git
cd .NancyFxViaAspNetCore
dotnet run次に、Webbrowserでhttp://localhost:5000入力して入力します。