Share via


StaticFilesEndpointRouteBuilderExtensions.MapFallbackToFile 方法

定義

多載

MapFallbackToFile(IEndpointRouteBuilder, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

MapFallbackToFile(IEndpointRouteBuilder, String, StaticFileOptions)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

MapFallbackToFile(IEndpointRouteBuilder, String, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

MapFallbackToFile(IEndpointRouteBuilder, String, String, StaticFileOptions)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

MapFallbackToFile(IEndpointRouteBuilder, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToFile(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ filePath);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToFile (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string filePath);
static member MapFallbackToFile : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToFile (endpoints As IEndpointRouteBuilder, filePath As String) As IEndpointConventionBuilder

參數

filePath
String

要提供之檔案的檔案路徑。

傳回

IEndpointRouteBuilder

備註

MapFallbackToFile(IEndpointRouteBuilder, String) 是要處理要求 URL 路徑不包含檔案名,且沒有符合其他端點的情況。 這方便將動態內容的要求路由傳送至 SPA 架構,同時允許要求不存在的檔案導致 HTTP 404。

將會使用 的 StaticFileMiddleware 預設值 StaticFileOptions

MapFallbackToFile(IEndpointRouteBuilder, String) 使用 模式 {*path:nonfile} 註冊端點。 已註冊端點的順序會是 int.MaxValue

適用於

MapFallbackToFile(IEndpointRouteBuilder, String, StaticFileOptions)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToFile(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ filePath, Microsoft::AspNetCore::Builder::StaticFileOptions ^ options);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToFile (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string filePath, Microsoft.AspNetCore.Builder.StaticFileOptions options);
static member MapFallbackToFile : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * Microsoft.AspNetCore.Builder.StaticFileOptions -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToFile (endpoints As IEndpointRouteBuilder, filePath As String, options As StaticFileOptions) As IEndpointConventionBuilder

參數

filePath
String

要提供之檔案的檔案路徑。

傳回

IEndpointRouteBuilder

備註

MapFallbackToFile(IEndpointRouteBuilder, String, StaticFileOptions) 是要處理要求 URL 路徑不包含檔案名,且沒有其他端點相符的情況。 這方便將動態內容的要求路由傳送至 SPA 架構,同時允許要求不存在的檔案導致 HTTP 404。

MapFallbackToFile(IEndpointRouteBuilder, String, StaticFileOptions) 使用 模式 {*path:nonfile} 註冊端點。 已註冊端點的順序會是 int.MaxValue

適用於

MapFallbackToFile(IEndpointRouteBuilder, String, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToFile(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern, System::String ^ filePath);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToFile (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, string filePath);
static member MapFallbackToFile : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * string -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToFile (endpoints As IEndpointRouteBuilder, pattern As String, filePath As String) As IEndpointConventionBuilder

參數

pattern
String

路由模式。

filePath
String

要提供之檔案的檔案路徑。

傳回

IEndpointRouteBuilder

備註

MapFallbackToFile(IEndpointRouteBuilder, String, String) 是要處理要求 URL 路徑不包含檔案名,且沒有符合其他端點的情況。 這方便將動態內容的要求路由傳送至 SPA 架構,同時允許要求不存在的檔案導致 HTTP 404。

將會使用 的 StaticFileMiddleware 預設值 StaticFileOptions

已註冊端點的順序會是 int.MaxValue

此多載會使用所提供的 pattern 逐字。 :nonfile使用路由限制來排除靜態檔案的要求。

適用於

MapFallbackToFile(IEndpointRouteBuilder, String, String, StaticFileOptions)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序之非檔案名的要求。 系統會將要求路由傳送至 StaticFileMiddleware 嘗試提供 所指定檔案的 filePath

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToFile(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern, System::String ^ filePath, Microsoft::AspNetCore::Builder::StaticFileOptions ^ options);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToFile (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, string filePath, Microsoft.AspNetCore.Builder.StaticFileOptions options);
static member MapFallbackToFile : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * string * Microsoft.AspNetCore.Builder.StaticFileOptions -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToFile (endpoints As IEndpointRouteBuilder, pattern As String, filePath As String, options As StaticFileOptions) As IEndpointConventionBuilder

參數

pattern
String

路由模式。

filePath
String

要提供之檔案的檔案路徑。

傳回

IEndpointRouteBuilder

備註

MapFallbackToFile(IEndpointRouteBuilder, String, String, StaticFileOptions) 是要處理要求 URL 路徑不包含檔案名,且沒有符合其他端點的情況。 這方便將動態內容的要求路由傳送至 SPA 架構,同時允許要求不存在的檔案導致 HTTP 404。

已註冊端點的順序會是 int.MaxValue

此多載會使用所提供的 pattern 逐字。 :nonfile使用路由限制來排除靜態檔案的要求。

適用於