Corrigindo ordem das rotas da API para evitar interceptação do app.get('*')
This commit is contained in:
@@ -4566,10 +4566,6 @@ app.post('/api/chat', requireAuth, async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Rota coringa para redirecionar para index.html
|
||||
app.get('*', requireAuth, (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
||||
});
|
||||
|
||||
|
||||
// ============================================================
|
||||
@@ -4689,6 +4685,11 @@ app.delete('/api/alunos/:id', requireAuth, async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Rota coringa para redirecionar para index.html
|
||||
app.get('*', requireAuth, (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
||||
});
|
||||
|
||||
app.listen(PORT, '0.0.0.0', () => {
|
||||
console.log(`Servidor rodando na porta ${PORT}`);
|
||||
initDatabase();
|
||||
|
||||
Reference in New Issue
Block a user