Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
fix(all): fixed routing and debugging with cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
wesdevpro committed Nov 27, 2023
1 parent 9dfe40b commit 1448368
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 43 deletions.
2 changes: 0 additions & 2 deletions src/EducationTrail/EducationTrail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<SpaRoot>ClientApp\</SpaRoot>
<SpaProxyServerUrl>https://localhost:5002</SpaProxyServerUrl>
<!-- <SpaProxyServerUrl Condition="'$(RequiresHttps)' == 'True'">https://localhost:5002</SpaProxyServerUrl>
<SpaProxyServerUrl Condition="'$(RequiresHttps)' != 'True'">http://localhost:5002</SpaProxyServerUrl> -->
<SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
12 changes: 7 additions & 5 deletions src/EducationTrail/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
39 changes: 12 additions & 27 deletions src/EducationTrail/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}
16 changes: 16 additions & 0 deletions src/EducationTrail/appsettings.Production.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://localhost:5001"
}
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 0 additions & 9 deletions src/EducationTrail/appsettings.json

This file was deleted.

0 comments on commit 1448368

Please sign in to comment.