From d506edcaf2da6be295119e3555f556b82efe6905 Mon Sep 17 00:00:00 2001 From: Thomas CHAZOT Date: Tue, 5 Dec 2023 10:14:21 +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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cryptide_project/server.js b/cryptide_project/server.js index 0ed5fb2..f92fafe 100644 --- a/cryptide_project/server.js +++ b/cryptide_project/server.js @@ -5,23 +5,23 @@ const app = express(); const port = process.env.PORT || 80; // Servir les fichiers statiques depuis le dossier 'build' -app.use(express.static(path.join(__dirname, 'build'))); +app.use(express.static(path.join(__dirname))); // 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, 'build/static/js'))); +}, express.static(path.join(__dirname, '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, 'build/static/css'))); +}, express.static(path.join(__dirname, 'static/css'))); // Route par défaut pour servir l'application React app.get('*', (req, res) => { - res.sendFile(path.join(__dirname, 'build', 'index.html')); + res.sendFile(path.join(__dirname, 'index.html')); }); // Démarrer le serveur