feat: serve mobile UI bundle for mobile devices or /mobile path
continuous-integration/webhook Deploy concluído (VPS4)
continuous-integration/webhook Deploy concluído (VPS4)
This commit is contained in:
@@ -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')) {
|
if (req.path.startsWith('/api') || req.path.startsWith('/uploads') || req.path.startsWith('/updates') || req.path.startsWith('/socket.io')) {
|
||||||
return next();
|
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'));
|
res.sendFile(path.join(__dirname, 'dental-client', 'dist', 'index.html'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user