Front End
Backend
// importing code
const express = require('express')
const app = express()
// endpoints, or routes that our users will hit
// from front end to perform some action
app.get('/api/users', (request, response) => {
response.status(200).send(users)
})
// starting our server
const PORT = 3333
app.listen(PORT, () => console.log(`app running on ${PORT}`))
app.get('/api/users', (request, response) => {
response.status(200).send(users)
})
URL ending
Callback function with a request and response param. We use the request to see if the user sent anything and the response to send something back to the user. Often called handler
Business logic. In this case we are just sending back all users