From a45a82b3a8f35404560bbc65f6ada699de90db87 Mon Sep 17 00:00:00 2001 From: Maciej Kotowski Date: Mon, 4 Oct 2021 17:07:32 +0200 Subject: [PATCH] fix --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e876448..0101246 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ app.use( extended: true, }) ); -app.use(express.static(path.join(__dirname, 'build'))); +app.use(express.static(path.join(__dirname, 'client/build'))); app.use( cors({ origin: "*", @@ -27,6 +27,9 @@ mongoose }) .then(() => console.log("connected")) .catch((err) => console.log(err)); + app.get('/', (req,res) =>{ + res.sendFile(path.join(__dirname+'/client/build/index.html')); + }); app.get("/api/getEvents", async (req, res) => { try { const event = await events.find();