Mobile and Docker Update

This commit is contained in:
2026-01-26 10:11:17 +00:00
parent 6afbfd793a
commit 8b939cbbe1
7 changed files with 25 additions and 192 deletions

View File

@@ -25,7 +25,7 @@ app.use(express.urlencoded({ extended: true, limit: '50mb' }));
*/
app.use('/api', async (req, res) => {
const targetUrl = `${API_URL}${req.originalUrl}`;
try {
const fetchOptions = {
method: req.method,
@@ -41,10 +41,10 @@ app.use('/api', async (req, res) => {
}
const response = await fetch(targetUrl, fetchOptions);
// Get content type from response
const contentType = response.headers.get('content-type');
// Set response headers
res.status(response.status);
if (contentType) {
@@ -52,7 +52,7 @@ app.use('/api', async (req, res) => {
}
// Handle different response types
if (contentType && (contentType.includes('application/pdf') ||
if (contentType && (contentType.includes('application/pdf') ||
contentType.includes('text/plain') ||
contentType.includes('application/octet-stream'))) {
// Binary/file responses
@@ -78,7 +78,7 @@ const buildPath = path.join(__dirname, '../build');
app.use(express.static(buildPath));
// SPA fallback - serve index.html for all other routes
app.get('*', (req, res) => {
app.get(/.*/, (req, res) => {
res.sendFile(path.join(buildPath, 'index.html'));
});