Add kiosk launcher downloads and player URL resolution
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user