Routeslist
v1.1.2.1
LoutesList는 .NET 애플리케이션의 모든 경로를 명확하고 간결한 방식으로 볼 수있는 편리한 도구입니다. 경로의 방법, URI, 컨트롤러, 작업 및 미들웨어를 쉽게 검사하고 요구에 맞게 출력을 사용자 정의 할 수 있습니다. LoutesList는 .NET Core App 3.1, .NET5.0, .NET 6, .NET7.0, Razor Pages, ASP.NET MVC 및 Blazor Server 프로젝트와 함께 작동합니다.
호환 가능 :




nuget.org에서
Install-Package RoutesList services.AddRoutesList 를 추가하여 CONFIGURESERVICE 메서드를 추가하십시오.
예:
startup.cs
\ .. .
public void ConfigureServices ( IServiceCollection services )
{
\ .. .
services . AddRoutesList ( ) ;
}구성 메소드에 추가하십시오
예:
startup.cs
\ .. .
public void Configure (
IApplicationBuilder app ,
IWebHostEnvironment env ,
)
{
\ .. .
app . UseRoutesList ( ) ;
} 기본 엔드 포인트 : http://your_application_address/routes
예:
program.cs
using RoutesList . Gen ;
var builder = WebApplication . CreateBuilder ( args ) ;
// Add services to the container.
builder . Services . AddRazorPages ( ) ;
builder . Services . AddRoutesList ( ) ; < -- usage
var app = builder . Build ( ) ;
// Configure the HTTP request pipeline.
if ( ! app . Environment . IsDevelopment ( ) ) {
app . UseExceptionHandler ( "/Error" ) ;
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app . UseHsts ( ) ;
}
app . UseHttpsRedirection ( ) ;
app . UseStaticFiles ( ) ;
app . UseRouting ( ) ;
app . UseAuthorization ( ) ;
app . MapRazorPages ( ) ;
app . UseRoutesList ( ) ; < -- usage
app . Run ( ) ;
public partial class Program { } public class Program
{
public static void Main ( string [ ] args )
{
var builder = WebApplication . CreateBuilder ( args ) ;
// Add services to the container.
builder . Services . AddRazorPages ( ) ;
builder . Services . AddServerSideBlazor ( ) ;
builder . Services . AddSingleton < WeatherForecastService > ( ) ;
builder . Services . AddRoutesList ( ) ;
var app = builder . Build ( ) ;
// Configure the HTTP request pipeline.
if ( ! app . Environment . IsDevelopment ( ) ) {
app . UseExceptionHandler ( "/Error" ) ;
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app . UseHsts ( ) ;
}
app . UseHttpsRedirection ( ) ;
app . UseStaticFiles ( ) ;
app . UseRouting ( ) ;
app . MapBlazorHub ( ) ;
app . MapFallbackToPage ( "/_Host" ) ;
app . UseRoutesList ( options => {
options . SetAppAssembly ( typeof ( Program ) . Assembly ) ; < -- setup current application webassembly with blazor component
} ) ;
app . Run ( ) ;
}
} app.userouteslist에서 옵션을 전달할 수 있습니다
| 이름 | 설명 |
|---|---|
| 엔드 포인트 | 엔드 포인트 이름 |
| 제목 | 웹 사이트 제목 |
| 정착 | 테이블 용 템플릿 클래스를 추가하십시오 |
| setAppassembly | Blazor 구성 요소와 함께 현재 응용 프로그램 어셈블리를 설정하십시오 |
startup.cs
public void Configure (
IApplicationBuilder app ,
IWebHostEnvironment env ,
)
{
IDictionary < string , string [ ] > dict = new Dictionary < string , string [ ] > ( ) ;
string [ ] classes = dict [ "table" ] = new string [ 2 ] { "table" , "table-striped" } ;
app . UseRoutesList ( options => {
options . Endpoint = "your_new_endpoints" ;
options . Tittle = "Your new Title for site" ;
options . SetTableClasses ( classes ) ;
options . SetAppAssembly ( typeof ( Program ) . Assembly )
} ) ;
}program.cs
var builder = WebApplication . CreateBuilder ( args ) ;
// Add services to the container.
builder . Services . AddRazorPages ( ) ;
builder . Services . AddControllersWithViews ( ) ;
var app = builder . Build ( ) ;
// Configure the HTTP request pipeline.
if ( ! app . Environment . IsDevelopment ( ) )
{
app . UseExceptionHandler ( "/Error" ) ;
app . UseHsts ( ) ;
}
app . UseHttpsRedirection ( ) ;
app . UseStaticFiles ( ) ;
app . UseAuthorization ( ) ;
app . MapGet ( "/hi" , ( ) => "Hello!" ) ;
app . MapDefaultControllerRoute ( ) ;
app . MapRazorPages ( ) ;
app . UseRoutesList ( options => {
options . Endpoint = "your_new_endpoints" ;
options . Tittle = "Your new Title for site" ;
options . SetTableClasses ( classes ) ;
options . SetAppAssembly ( typeof ( Program ) . Assembly )
} ) ;
app . Run ( ) ; 새로운 기능 추가/제안, 버그 수정, 새 파일 형식 문서 또는 문법 편집 등의 기여는 항상 환영합니다. 이를 위해 새로운 github 문제를 만들고 문제를 설명하고 버그/강화에 대한 문제 태그를 추가하십시오.