fix: Correct environment variables and MIME types for production
- Change VITE_SERVER_URL to SERVER_URL in docker-compose - Add dist directory serving for built assets - Configure Express to serve JS modules with correct MIME type - Fix undefined Game Server in containers
This commit is contained in:
@@ -153,8 +153,12 @@ app.post('/api/admin/cancel-game', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Serve static files from current directory (AFTER API routes)
|
||||
// Configure MIME types for modules
|
||||
express.static.mime.define({'application/javascript': ['js', 'mjs']});
|
||||
|
||||
// Serve static files from current directory and dist (AFTER API routes)
|
||||
app.use(express.static('.'));
|
||||
app.use(express.static('dist'));
|
||||
|
||||
// Serve main HTML file for SPA routes
|
||||
app.get('*', (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user