create empty file

This commit is contained in:
2022-11-30 21:43:22 -05:00
parent 5b3b6711d9
commit 0489eb4b7e
2 changed files with 9 additions and 38 deletions

View File

@ -13,6 +13,15 @@ if (!app.Environment.IsDevelopment())
app.UseHsts();
}
// create file
var configuration = app.Services.GetService<IConfiguration>();
var filePath = configuration["ContentFilePath"];
if (!File.Exists(filePath))
{
File.WriteAllText(filePath, string.Empty);
}
app.UseHttpsRedirection();
app.UseStaticFiles();