This documentation provides details about the routes and endpoints exposed by the index.js
file located in the route/v1
directory.
Endpoint: POST /signup
Registers a new user.
Request Headers:
Content-Type: application/json
Request Body:
{
"username": "string",
"email": "string",
"password": "string"
}
Endpoint: POST /signin
Authenticates a user.
Request Headers:
Content-Type: application/json
Request Body:
{
"email": "string",
"password": "string"
}
Endpoint: GET /isAuthenticated
Checks if the user is authenticated.
Response:
{
"isAuthenticated": true
}
Endpoint: POST /isAdmin
Checks if the user is an admin.
Request Headers:
Content-Type: application/json
Request Body:
{
"userId": "string"
}
Response:
{
"isAdmin": true
}
Endpoint: POST /toRole
Changes the role of a user.
Request Headers:
Content-Type: application/json
Request Body:
{
"userId": "string",
"role": "string"
}
Please note that this documentation assumes the use of a RESTful API convention.
The routes and endpoints are based on the code provided in the index.js
file.
Make sure to replace placeholders like :userId
with actual values when making requests.
Additionally, ensure that you have implemented the required controller functions and middlewares as indicated in the code.