Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Build REST API using Node, Express and mongoDB and Postman

Notifications You must be signed in to change notification settings

dhawkinson/TH11-RestAPI

Open more actions menu

Repository files navigation

TH11-RestAPI

Full Stack Java Script Project 11 - Treehouse TechDegree

Build REST API using Node, Express and mongoDB and Postman

Create a REST API using Express. The API will provide a way for users to review educational courses: users can see a list of courses in a database; add courses to the database; and add reviews for a specific course.

To complete this project, you’ll use your knowledge of REST API design, Node.js, and Express to create API routes, along with Mongoose and MongoDB for data modeling, validation, and persistence.

Confirmation of all routes will be performed using Postman.

The project entails the following steps:

  1. Set up a database connection.
  2. Create your Mongoose schema and models. Your database schema should match the following requirements:
    • User
    • Course
    • Review
  3. Seed your database with data.
  4. Create the user routes
  5. Create the course routes
  6. Update any POST and PUT routes to return Mongoose validation errors.
  7. Update the User model to store the user's password as a hashed value.
  8. Create an authentication method on the user model to return the user document based on their credentials
  9. Set up permissions to require users to be signed in

Extra Credit

To get an "exceeds" rating, you can expand on the project in the following ways:

  1. Review model - Validation added to prevent a user from reviewing their own course
  2. User routes
    • Tests have been written for the following user stories:
      • When I make a request to the GET /api/users route with the correct credentials, the corresponding user document is returned
      • When I make a request to the GET /api/users route with the invalid credentials, a 401 status error is returned
  3. Course routes
    • When returning a single course for the GET /api/courses/:courseId route, use Mongoose deep population to return only the fullName of the related user on the course model and each review returned with the course model.

About

Build REST API using Node, Express and mongoDB and Postman

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.