Spaces:
Running
Running
File size: 447 Bytes
8990a66 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
const express = require('express');
const app = express();
const path = require('path');
// Servir les fichiers statiques
app.use(express.static(path.join(__dirname, 'public')));
// Route principale
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});
// Démarrer le serveur
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Serveur actif sur http://localhost:${PORT}`);
});
|