DefautFiles and FileServer in ASP.NET Core

added by DotNetKicks
10/25/2017 1:19:28 PM

2 Kicks, 215 Views

var clientPath = Path.Combine(env.ContentRootPath, "client"); var fileprovider = new PhysicalFileProvider(clientPath); var fileServerOptions = new FileServerOptions(); fileServerOptions.DefaultFilesOptions .DefaultFileNames = new[] { "foo.html" }; fileServerOptions.FileProvider = fileprovider; app.UseFileServer(fileServerOptions);


0 comments