Skip to content

bc14_w9_recap-task_node-express-api-Trip25 created by GitHub Classroom

Notifications You must be signed in to change notification settings

Trip25/UserForm-Node-Express-API

 
 

Repository files navigation

Open in Visual Studio Code

Recap task

Create your API routes

👉 Create a REST API using the user JSON data found in data/users.json. Your API must be RESTful with all CRUD routes (create, read, update, delete).

Operation Path Response body shape
Get all users /api/users { success: true, payload: array of user objects }
Get user by id /api/users/:id { success: true, payload: user object }
Create new user /api/users { success: true, payload: newly created user object }
Update user by id /api/users/:id { success: true, payload: new user object (after replacement) }
Delete user by id /api/users/:id { success: true, payload: deleted user }

Remember to break down the task and tackle it step by step.

  • Start by looking at the data and familiarizing yourself with how it's structured.
  • Make a plan for each CRUD route, and break down the logic in that plan until you can't break it down anymore!
  • Code each route handler in the app.js file.
  • Code each helper function in the users.js file.
    • Test each route with Postman or Thunder Client as you finish it before you move on to the next one!
    • Add, commit, and push after you complete each route/helper function.

Bonus challenges (These are optional if you're ready for an extra challenge!)

⭐ If you've finished everything above and have time left over, keep developing! Think through what ideas you can come up with to improve functionality.

This can include:

  • Implementing the correct HTTP response status code
  • Making a front end to consume and display your data
  • Additional routes that include searching the data using query strings
  • Implementing middleware (start with a simple logger, and then explore what else you can add)

About

bc14_w9_recap-task_node-express-api-Trip25 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.6%
  • CSS 17.9%
  • HTML 12.5%