NancyFxViaAspNetCore
1.0.0
ASP.NET CORE 3.1 템플릿 프로젝트 NANCYFX 1.4.4 라우팅을 일반 MVC 대신 사용합니다.
나는 v1.4.4 전에 NancyFX에서 라우팅을 좋아하도록 성장했습니다.
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 ) ;
} ;
}
}그러나 NanceFX가 중단되었으므로 대신 ASP.NET Core 내에서 유사한 라우팅을 구현하기로 결정했습니다.
git clone https://github.com/zwcloud/NancyFxViaAspNetCore.git
cd .NancyFxViaAspNetCore
dotnet run 그런 다음 웹 브라우저에서 http://localhost:5000 입력하고 입력하십시오.