Documentaion of my first API using express. Justs going to detail the all the routes and their responses for my reference.
All Endpoint for User
- Get all Users :
GET /api/users
- Get User by username :
GET /api/users/:username
- Get User by id :
GET /api/users/id/:id
- Create new User :
POST /api/users
- Remove a User :
DELETE /api/users
All Endpoint for Profile
- Get all Profiles :
GET /api/profiles
- Get Profile by username :
GET /api/profiles/:username
- Create new Profile :
POST /api/profiles
- Update a Profile :
PUT /api/profiles
- Remove a Profile :
DELETE /api/profiles
All Endpoint for Post
- Get all Posts :
GET /api/posts
- Get all Posts with a specific username :
GET /api/posts/:username
- Get a Post using an id :
GET /api/posts/id/:id
- Create a Post :
POST /api/posts/:username
- Delete a Post :
DELETE /api/posts/:id
All Endpoint for Comment
- Get all Comments :
GET /api/comments
- Get a Comment with id :
GET /api/comments/:id
- Get all Comments with a username :
GET /api/comments/username/:username
- Create a new Comment :
POST /api/comments/:postId
- Delete a Comment :
DELETE /api/comments/:id
EndPoint for Authorization
Showing the relation with each collection in the database.
All the contents of each collection in the database.