diff --git a/src/EducationTrail/EducationTrail.csproj b/src/EducationTrail/EducationTrail.csproj index 4f4c8df..b83fe9e 100644 --- a/src/EducationTrail/EducationTrail.csproj +++ b/src/EducationTrail/EducationTrail.csproj @@ -7,8 +7,6 @@ True ClientApp\ https://localhost:5002 - npm start enable diff --git a/src/EducationTrail/Program.cs b/src/EducationTrail/Program.cs index afbb21f..b98ef28 100644 --- a/src/EducationTrail/Program.cs +++ b/src/EducationTrail/Program.cs @@ -4,14 +4,16 @@ var app = builder.Build(); -app.UseStaticFiles(); - -app.MapFallbackToFile("index.html"); - app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); -app.Run(); +if(app.Environment.IsProduction()) +{ + app.UseStaticFiles(); + app.MapFallbackToFile("index.html"); +} + +app.Run(); \ No newline at end of file diff --git a/src/EducationTrail/Properties/launchSettings.json b/src/EducationTrail/Properties/launchSettings.json index 9c8326f..a9da8ff 100644 --- a/src/EducationTrail/Properties/launchSettings.json +++ b/src/EducationTrail/Properties/launchSettings.json @@ -1,29 +1,14 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:48063", - "sslPort": 0 - } - }, - "profiles": { - "Company.WebApplication1": { - "commandName": "Project", - "launchBrowser": true, - "applicationUrl": "http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development", - "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development", - "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" +{ + "profiles": { + "EducationTrail": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" + }, + "isDefault": true } } - } -} \ No newline at end of file + } \ No newline at end of file diff --git a/src/EducationTrail/appsettings.Production.json b/src/EducationTrail/appsettings.Production.json new file mode 100644 index 0000000..3b79456 --- /dev/null +++ b/src/EducationTrail/appsettings.Production.json @@ -0,0 +1,16 @@ +{ + "AllowedHosts": "*", + "Kestrel": { + "Endpoints": { + "Https": { + "Url": "https://localhost:5001" + } + } + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} \ No newline at end of file diff --git a/src/EducationTrail/appsettings.json b/src/EducationTrail/appsettings.json deleted file mode 100644 index 10f68b8..0000000 --- a/src/EducationTrail/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -}