Express Yourself (through routes) - adriana-401-advanced-javascript/seattle-javascript-401n13 GitHub Wiki
Using routes in express is how we can create endpoints using HTTP methods to do what we need to do in the endpoint. We also declare functions to show what needs to be done for that endpoint to run.
Example:
app.get('/example/b', function (req, res, next) {
console.log('the response will be sent by the next function ...')
next()
}, function (req, res) {
res.send('Hello from B!')
})
Here we are using an HTTP get method to get to the /example/b endpoint, the function sends a response saying "Hello from B!"