await db.collection(`messages`).insertOne(request.body)The insertOne method could take some time to complete, so
await
is used, which means async
must be
placed on front of the function:
app.post(`/message`, async (request, response) => {