.net6 API 静态路径
编辑
70
2023-08-22
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "Resources")),
RequestPath = "/Resources",
OnPrepareResponse = ctx =>
{
ctx.Context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
}
});
- 0
- 0
-
分享