Skip to content

API Routes

Moiz Ahmad edited this page Sep 14, 2021 · 7 revisions

Users:

POST /api/users

Creates a new user when they sign up

GET /api/users/:userId

Reads a user's information by ID

PUT /api/users/:userId

Updates a user's information by ID

DELETE /api/users/:userId

Deletes a user by ID

Curriculum:

GET /api/courses

Fetches data for all courses

GET /api/lessons

Fetches data for all lessons

Comments:

POST /api/comments

Creates a new comment for a lesson

GET /api/lessons/:lessonId/comments

Fetches data for all comments on a lesson

PUT /api/comments/:commentId

Updates a user's comment on a lesson

DELETE /api/comments/:commentId

Deletes a user's comment on a lesson

Path:

POST /api/aspirations

Creates a new aspiration

GET /api/users/:userId/aspirations

Fetches data for a user's aspirations

PUT /api/aspirations/:aspirationId

Updates a user's aspiration status

DELETE /api/aspirations/:aspirationId

Deletes a user's aspiration

Votes: *

POST /api/votes

Creates a new vote

GET /api/lessons/:lessonId/votes

Fetches data for all the votes on a lesson

PUT /api/votes/:voteId

Updates a user's vote to an upvote or downvote

DELETE /api/votes/:voteId

Deletes a user's vote

Clone this wiki locally