Created
May 11, 2021 14:45
-
-
Save fdrobidoux/2944946d18a6dd928f73cbfc69529cc8 to your computer and use it in GitHub Desktop.
Add static files in ASP.NET Core 3.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IWebHostEnvironment _env; | |
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) | |
{ | |
app.UseStaticFiles(new StaticFileOptions | |
{ | |
FileProvider = new PhysicalFileProvider(Path.Combine(_env.ContentRootPath, "Images")), | |
RequestPath = "/images" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment