feat: serve mobile UI bundle for mobile devices or /mobile path
continuous-integration/webhook Deploy concluído (VPS4)

This commit is contained in:
VPS 4 Deploy Agent
2026-06-03 17:16:03 +02:00
parent 68dc2965da
commit b5d5e8cbf7
+9
View File
@@ -746,6 +746,15 @@ app.get('*', (req, res, next) => {
if (req.path.startsWith('/api') || req.path.startsWith('/uploads') || req.path.startsWith('/updates') || req.path.startsWith('/socket.io')) {
return next();
}
const userAgent = req.headers['user-agent'] || '';
const isMobile = /mobile/i.test(userAgent) || /android/i.test(userAgent) || /iphone/i.test(userAgent);
// Serve the Mobile Prototype Bundle for mobile devices or explicit /mobile route
if (req.path.startsWith('/mobile') || isMobile) {
return res.sendFile(path.join(__dirname, '..', 'scoreodonto-mobile', 'Score RX Mobile.html'));
}
res.sendFile(path.join(__dirname, 'dental-client', 'dist', 'index.html'));
});