Skip to content

Instantly share code, notes, and snippets.

@fdrobidoux
Created May 11, 2021 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fdrobidoux/2944946d18a6dd928f73cbfc69529cc8 to your computer and use it in GitHub Desktop.
Save fdrobidoux/2944946d18a6dd928f73cbfc69529cc8 to your computer and use it in GitHub Desktop.
Add static files in ASP.NET Core 3.1
// 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