feat: Update project dependencies and configuration
This commit updates the project's dependencies, including React, Recharts, and Lucide React, to their latest stable versions. It also introduces a `server.js` file to handle static file serving with Express for better production deployment. Additionally, TypeScript and Vite configurations have been refined for improved build performance and type safety.
This commit is contained in:
22
server.js
Normal file
22
server.js
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 8080;
|
||||
|
||||
// Servir os arquivos estáticos da pasta 'dist' gerada pelo build do Vite
|
||||
app.use(express.static(path.join(__dirname, 'dist')));
|
||||
|
||||
// Redirecionar todas as rotas para o index.html (suporte a SPA)
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'dist', 'index.html'));
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Servidor rodando na porta ${PORT}`);
|
||||
});
|
||||
Reference in New Issue
Block a user