From f32a2382b52a7629321daa8dc06d9f209772037f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Sepp=C3=A4?= <joasep@utu.fi> Date: Tue, 7 Mar 2023 08:59:44 +0200 Subject: [PATCH] Trying to get DB to work --- messagesAppBackend/src/server.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/messagesAppBackend/src/server.ts b/messagesAppBackend/src/server.ts index c11eb81..9a8cac1 100644 --- a/messagesAppBackend/src/server.ts +++ b/messagesAppBackend/src/server.ts @@ -17,17 +17,12 @@ async function addMessage(messageContent){ messages = await Message.find() console.log(messages); - (async () => { - await app.get("/", (req, res) => { - res.send(messages) - }) - })() - - await mongoose.disconnect() } - +app.get("/", (req, res) => { + res.send("Hello") +}) const port = process.env.PORT || 3000 -- GitLab