AJAX

Step 6: To parse the request sent to the server, add the following below the app variable:
app.use(express.json())
This is another example of middleware. In this case, the middleware is enabling the endpoints to parse requests sent in JSON format. To see the message sent to the server, add the following at the start of your endpoint for posting chat messages:
console.log(request.body.message)
Last step Next step