[backend/startup] Add --https flag & corresponding launch profiles for development purposes
This commit is contained in:
parent
f9cc63a179
commit
1a4dd75301
3 changed files with 27 additions and 1 deletions
|
@ -17,6 +17,10 @@ public static class StartupHelpers
|
|||
--recompute-counters Recomputes denormalized database counters.
|
||||
--migrate-storage Migrates all files currently stored locally to the
|
||||
configured object storage bucket.
|
||||
--https For development purposes only. Listens using https
|
||||
instead of http on the specified port.
|
||||
--environment <env> Specifies the ASP.NET Core environment. Available options
|
||||
are 'Development' and 'Production'.
|
||||
""");
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,16 @@
|
|||
"ASPNETCORE_ENVIRONMENT": "Production"
|
||||
}
|
||||
},
|
||||
"Development (HTTPS)": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": false,
|
||||
"externalUrlConfiguration": true,
|
||||
"commandLineArgs": "--https",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Debug (WASM)": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
|
@ -29,6 +39,18 @@
|
|||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Debug (WASM, HTTPS)": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": false,
|
||||
"externalUrlConfiguration": true,
|
||||
"commandLineArgs": "--https",
|
||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||
"applicationUrl": "https://localhost:3000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ app.MapFallbackToPage("/Shared/FrontendSPA");
|
|||
|
||||
app.Urls.Clear();
|
||||
if (config.ListenSocket == null)
|
||||
app.Urls.Add($"http://{config.ListenHost}:{config.ListenPort}");
|
||||
app.Urls.Add($"{(args.Contains("--https") ? "https" : "http")}://{config.ListenHost}:{config.ListenPort}");
|
||||
|
||||
await app.StartAsync();
|
||||
app.SetKestrelUnixSocketPermissions();
|
||||
|
|
Loading…
Add table
Reference in a new issue