Task apis
-
Clone the repository:
-
Install dependencies: npm i
-
Create a
.env
file at the root of the project and add the data sent in mail:
To start the server, run: npm run start
-
Register User
- URL:
http://localhost:3005/v1/auth/register
- Method:
POST
- Description: Registers a new user.
- Request Body:
{ "name": "string", "email": "string", "password": "string" }
- Response: Returns user data with a JWT token.
- URL:
-
Login User
- URL:
http://localhost:3005/v1/auth/login
- Method:
POST
- Description: Logs in an existing user.
- Request Body:
{ "email": "string", "password": "string" }
- Response: Returns user data with a JWT token.
- URL:
-
User Dashboard
- URL:
http://localhost:3005/v1/user/dashboard
- Method:
GET
- Description: Retrieves user dashboard data.
- Authorization: Requires JWT token in the
Authorization
header.
- URL:
-
User Profile
- URL:
http://localhost:3005/v1/user/profile/:userId
- Method:
GET
- Description: Retrieves user profile data for the specified user ID.
- Authorization: Requires JWT token in the
Authorization
header.
- URL:
- Authentication for the
/v1/user/profile/:userId
endpoint is performed using JSON Web Tokens (JWT). Include the JWT token in theAuthorization
header of the request.
- TypeScript
- Node.js
- Express.js
- JSON Web Tokens (JWT)