Node

Step 6: The second argument for the get method is a function specifying what to do when a client sends a request. Put the following function for the second argument:
app.get(`/`, (request, response) => {
  response.send(`hello world`)
})
This is an example of an arrow function, where the entire function is used as an argument. This function takes in a request object, and a response object. The response object is used to send a message back to the client. To summarize, when a client makes a get request to the homepage, the server responds with a message. This entire block is called an endpoint.
Last step Next step