Server-Port konfigurierbar statt hardcoded

- Program.cs: Port aus Config lesen mit Fallback 19000
- appsettings.json: Port: 19000 als Default
- ServerSettingsEndpoint: Port als erste Einstellung (mit Neustart-Hinweis)
This commit is contained in:
Meleki committed 2026-03-06 22:37:53 +01:00
1 parent bfd78278ab
commit dc2709b3cd
3 files changed
+4 -1

No files matched your search

+1
View File
@@ -22,6 +22,7 @@ public static class ServerSettingsEndpoint
// Definiert alle konfigurierbaren Properties mit Typ und Standardwert
private static readonly List<SettingDefinition> Definitions = new List<SettingDefinition>
{
new SettingDefinition("Port", "int", 19000, "Server-Port (erfordert Neustart)", "number"),
new SettingDefinition("AnthropicToken", "string", "", "Anthropic API Key", "password"),
new SettingDefinition("MaxIterations", "int", 100, "Max Tool-Loop Iterationen pro Chat", "number"),
new SettingDefinition("PayloadLogging", "bool", false, "API-Payloads loggen (Debug)", "toggle"),
+2 -1
View File
@@ -84,4 +84,5 @@ app.MapSharedEndpoints();
app.MapAdminEndpoints();
app.MapServerSettingsEndpoints();
app.Run("http://0.0.0.0:19000");
var port = app.Configuration.GetValue<int>("Port", 19000);
app.Run($"http://0.0.0.0:{port}");
+1
View File
@@ -6,6 +6,7 @@
}
},
"AllowedHosts": "*",
"Port": 19000,
"AnthropicToken": "",
"MaxIterations": 100,
"PayloadLogging": false,