diff --git a/index.js b/index.js index f816903a6..ba8312c96 100644 --- a/index.js +++ b/index.js @@ -175,6 +175,8 @@ if (process.env.NODE_ENV === "production") { app.use(session(sess)) +app.use(compression()) + app.use(express.static("build")) app.use(passport.initialize()) @@ -199,8 +201,6 @@ app.get("/logout", function (req, res) { res.redirect("/") }) -app.use(compression()) - app.get("*", (req, res) => { res.sendFile(path.resolve(__dirname, "build", "index.html")) })