Explorar el Código

Added default files configuration (index.html access)

Lukas Angerer hace 3 años
padre
commit
0ae0443750
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      src/RunnersMeet.Server/AppServer.cs

+ 8 - 1
src/RunnersMeet.Server/AppServer.cs

@@ -1,5 +1,5 @@
-using System.Net.Http.Headers;
 using Microsoft.AspNetCore.Authentication.JwtBearer;
+using Microsoft.AspNetCore.StaticFiles.Infrastructure;
 using Microsoft.IdentityModel.Tokens;
 using RunnersMeet.Server.GpxFormat;
 using RunnersMeet.Server.Persistence;
@@ -65,6 +65,13 @@ public class AppServer
 		app.UseHttpsRedirection();
 		app.UseCors();
 		app.UseAuthorization();
+		app.UseDefaultFiles(new DefaultFilesOptions()
+		{
+			DefaultFileNames = new List<string>
+			{
+				"index.html"
+			}
+		});
 		app.UseStaticFiles();
 
 		app.MapControllers();