Yesterday, we worked on strictly client side.
Today we are going to work on the server side of things.
This challenge has two phases in Express.js
- Inside the GET method, write out a response in JSON format
- Perform a GET request in the browser to your server side endpoint
- You should see output like this:
- Store the request data (this will be sent from the client)
- Write out a response in JSON. The output should have a status message, and the request data sent
- Output should look like this:
- Write a GET endpoint to
https://reqres.in/api/users?page=2'
on the server side. (This URL should NOT be seen in the browser, or within the script tags.)
- Write a function client side to pull data from your GET endpoint
- Format the obtained data and render it in HTML and append to the table.
- Write a POST endpoint to
https://reqres.in/api/users
on the server side. (This URL should NOT be seen in the browser, or within the script tags.)
- Create two form input fields:
* Name
* Job
- Create a Submit button
- Add an event listener to the Submit button
* Upon submit, obtain the values entered into the Name and Job form fields
* POST this data to your POST endpoint that you wrote server-side
* Write out a response on the server side so that you get the following output once the POST is successful: