User Router:
Route | Method | Request(s) | Response(s) | Description |
---|---|---|---|---|
/register |
POST | Body name: String email: String password: String |
Success201 CreatedFail 500 Internal Server Error |
Create a user |
/login |
POST | Body email: String password: String |
200 OKFail 401 Authorization Error |
Sign a user in |
/users |
GET | none |
200 OKFail 401 Authorization Error500 Internal Server Error |
Get all users |
/users/:id |
GET | Headers id: String |
200 OKFail 401 Authorization Error500 Internal Server Error |
Get one user |
/users/:id |
PUT | Headers id: String Body name: String email: String password: String |
200 OKFail 401 Authorization Error500 Internal Server Error |
Update one user |
/users/:id |
DELETE | Headers id: String |
200 OKFail 401 Authorization Error500 Internal Server Error |
Delete a user |
Question Router:
Route | Method | Request(s) | Response(s) | Description |
---|---|---|---|---|
/questions |
POST | Body title: String description: String upvotes: Number downvotes: Number |
Success201 CreatedFail 500 Internal Server Error |
Create a question |
/questions |
GET | none |
200 OKFail 401 Authorization Error500 Internal Server Error |
Get all questions |
/questions/:id |
GET | Headers id: String |
200 OKFail 401 Authorization Error500 Internal Server Error |
Get one question |
/questions/:id |
PUT | Headers id: String Body title: String description: String upvotes: Number downvotes: Number |
200 OKFail 401 Authorization Error500 Internal Server Error |
Update one question |
/questions/:id |
DELETE | Headers id: String |
200 OKFail 401 Authorization Error500 Internal Server Error |
Delete a question |
Answer Router:
Route | Method | Request(s) | Response(s) | Description |
---|---|---|---|---|
/answers |
POST | Body title: String description: String upvotes: Number downvotes: Number |
Success201 CreatedFail 500 Internal Server Error |
Create a answer |
/answers |
GET | none |
200 OKFail 401 Authorization Error500 Internal Server Error |
Get all answers |
/answers/:id |
GET | Headers id: String |
200 OKFail 401 Authorization Error500 Internal Server Error |
Get one answer |
/answers/:id |
PUT | Headers id: String Body title: String description: String upvotes: Number downvotes: Number |
200 OKFail 401 Authorization Error500 Internal Server Error |
Update one answer |
/answers/:id |
DELETE | Headers id: String |
200 OKFail 401 Authorization Error500 Internal Server Error |
Delete a answer |