fixe le premier démarrage
This commit is contained in:
parent
2b31a9b039
commit
394ed34399
1 changed files with 9 additions and 5 deletions
|
|
@ -14,16 +14,20 @@ namespace Yavsc
|
||||||
public void ConfigureFileServerApp(IApplicationBuilder app,
|
public void ConfigureFileServerApp(IApplicationBuilder app,
|
||||||
SiteSettings siteSettings, IHostingEnvironment env)
|
SiteSettings siteSettings, IHostingEnvironment env)
|
||||||
{
|
{
|
||||||
app.UseFileServer(new FileServerOptions()
|
var rootPath = Path.Combine(
|
||||||
{
|
|
||||||
FileProvider = new PhysicalFileProvider(
|
|
||||||
Path.Combine(
|
|
||||||
env.WebRootPath,
|
env.WebRootPath,
|
||||||
// TODO: add a ressource serveur id here,
|
// TODO: add a ressource serveur id here,
|
||||||
// or remove the blog entry id usage, to use the userid instead
|
// or remove the blog entry id usage, to use the userid instead
|
||||||
// and an user defined optional subdir.
|
// and an user defined optional subdir.
|
||||||
siteSettings.UserFiles.DirName
|
siteSettings.UserFiles.DirName
|
||||||
)),
|
);
|
||||||
|
var rootInfo = new DirectoryInfo(rootPath);
|
||||||
|
if (!rootInfo.Exists) rootInfo.Create();
|
||||||
|
|
||||||
|
|
||||||
|
app.UseFileServer(new FileServerOptions()
|
||||||
|
{
|
||||||
|
FileProvider = new PhysicalFileProvider(rootPath),
|
||||||
RequestPath = new PathString("/" + siteSettings.UserFiles.DirName),
|
RequestPath = new PathString("/" + siteSettings.UserFiles.DirName),
|
||||||
EnableDirectoryBrowsing = false
|
EnableDirectoryBrowsing = false
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue