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使用路由限制排除对静态文件的请求。

适用于