From 05d1a7bf6bb80812a52608e1b690afa2d1f11e66 Mon Sep 17 00:00:00 2001 From: Thomas CHAZOT Date: Tue, 5 Dec 2023 10:51:51 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'cryptide=5Fproject?= =?UTF-8?q?/server.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cryptide_project/server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cryptide_project/server.js b/cryptide_project/server.js index e71728d..d163f48 100644 --- a/cryptide_project/server.js +++ b/cryptide_project/server.js @@ -5,27 +5,27 @@ const app = express(); const port = process.env.PORT || 80; // Servir les fichiers statiques depuis le dossier 'build' -app.use(express.static(path.join(__dirname))); +app.use(express.static(path.join(__dirname), "build")); // Définir le type MIME pour les fichiers JavaScript app.use('/static/js', (req, res, next) => { res.type('application/javascript; charset=utf-8'); next(); -}, express.static(path.join(__dirname, 'static/js'))); +}, express.static(path.join(__dirname, '"build"/static/js'))); // Définir le type MIME pour les fichiers CSS app.use('/static/css', (req, res, next) => { res.type('text/css; charset=utf-8'); next(); -}, express.static(path.join(__dirname, 'static/css'))); +}, express.static(path.join(__dirname, '"build"/static/css'))); // Route par défaut pour servir l'application React app.get('*', (req, res) => { - res.sendFile(path.join(__dirname, 'index.html')); + res.sendFile(path.join(__dirname, '"build"/index.html')); }); // Démarrer le serveur app.listen(port, () => { console.log(`Serveur en cours d'exécution sur le port ${port}`); - console.log(path.join(__dirname, 'static/css')) + console.log(path.join(__dirname, '"build"/static/css')) });