james URL configuration refactoring

This commit is contained in:
EugeneTes
2026-01-20 11:41:01 +01:00
parent 7cd2c75d14
commit f3dc04f8ae
5 changed files with 12 additions and 7 deletions

View File

@@ -61,12 +61,14 @@ public class HeartbeatBackgroundTask
{
try
{
var url = _configuration.HeartbeatApiUrl;
var apiKey = _configuration.PrinterServerKey;
var url = _configuration.ApiUrl != null
? $"{_configuration.ApiUrl.TrimEnd('/')}/api/printerServer/heartbeat"
: null;
var apiKey = _configuration.ApiKey;
if (string.IsNullOrEmpty(url) || string.IsNullOrEmpty(apiKey))
{
_logger.LogWarning("Heartbeat not configured (missing HeartbeatApiUrl or PrinterServerKey)");
_logger.LogWarning("Heartbeat not configured (missing ApiUrl or ApiKey)");
return;
}

View File

@@ -2,5 +2,6 @@
"GroupId": "63e37295bd6f26dbd36164c0",
"RestaurantId": "63e37295bd6f26dbd36164c0",
"ApiKey": "Pd8X/VtXLWgl5Djy4ksjdHC3xboeoh5Jig3Qo4277GQ=",
"ApiUrl": "https://api.dev.gastrojames.ch",
"PrinterConfigurations": {}
}