mirror of
https://github.com/SirBlobby/Hoya26.git
synced 2026-02-04 03:34:34 -05:00
Mobile and Docker Update
This commit is contained in:
@@ -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'));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user