|
|
@ -103,10 +103,10 @@ io.on('connection', (socket) => { |
|
|
|
|
|
|
|
|
const PORT = process.env.PORT || 4000; |
|
|
const PORT = process.env.PORT || 4000; |
|
|
|
|
|
|
|
|
// SPA fallback — must come LAST before server.listen
|
|
|
app.get(/^\/(?!models|api|socket).*/, (req, res) => { |
|
|
app.get(/\/*/, (req, res) => { |
|
|
|
|
|
res.sendFile(path.join(__dirname, 'dist', 'index.html')); |
|
|
res.sendFile(path.join(__dirname, 'dist', 'index.html')); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
server.listen(PORT, () => { |
|
|
server.listen(PORT, () => { |
|
|
console.log(`Server listening on port ${PORT}`); |
|
|
console.log(`Server listening on port ${PORT}`); |
|
|
}); |
|
|
}); |
|
|
|