Add kiosk launcher downloads and player URL resolution

This commit is contained in:
2026-08-06 18:51:33 +01:00
parent 59730837ad
commit a4f8a807ff
23 changed files with 621 additions and 71 deletions
+7 -4
View File
@@ -1,7 +1,5 @@
// Shared route helpers for web view rendering and player URL formatting.
const PLAYER_PUBLIC_BASE_URL = (process.env.PLAYER_PUBLIC_BASE_URL || process.env.PLAYER_BASE_URL || 'http://localhost:3001').replace(/\/$/, '');
function escapeHtml(value) {
return String(value ?? '')
.replace(/&/g, '&')
@@ -11,8 +9,13 @@ function escapeHtml(value) {
.replace(/'/g, ''');
}
function screenPlayerUrl(slug) {
return `${PLAYER_PUBLIC_BASE_URL}/screen/${encodeURIComponent(slug)}`;
function screenPlayerUrl(slug, baseUrl) {
const normalizedBaseUrl = String(baseUrl || '').trim().replace(/\/$/, '');
if (!normalizedBaseUrl) {
return '';
}
return `${normalizedBaseUrl}/screen/${encodeURIComponent(slug)}`;
}
module.exports = {