fix(mobile): move baseUrl config to experiments.baseUrl and filter static assets in express wildcard handler

This commit is contained in:
Plena Finance Dev
2026-07-09 11:55:31 +05:30
parent 9c7c576c99
commit 65fdc108a8
2 changed files with 11 additions and 3 deletions

View File

@@ -49,6 +49,14 @@ app.get('/{*path}', (req, res, next) => {
if (req.path.startsWith(apiRoot)) return next();
if (req.path === '/_cron/tick') return next();
// Do not serve HTML for static assets or requests that do not accept HTML
const isAsset = /\.[a-z0-9]{2,4}$/i.test(req.path);
const acceptsHtml = req.headers.accept?.includes('text/html');
if (isAsset || !acceptsHtml) {
res.status(404).json({ success: false, error: 'Not found' });
return;
}
if (req.path.startsWith('/mobile')) {
res.sendFile(path.join(publicDir, 'mobile/index.html'), (err) => {
if (err) next();