|
32 | 32 |
|
33 | 33 | 3. Run the command `npm start` to start the User Service in production mode, or use `npm run dev` for development mode, which includes features like automatic server restart when you make code changes.
|
34 | 34 |
|
35 |
| -4. Using applications like Postman, you can interact with the User Service on port 3001. If you wish to change this, please update the `.env` file. |
| 35 | +4. Using applications like Postman, you can interact with the User Service on port 8082. If you wish to change this, please update the `.env` file. |
36 | 36 |
|
37 | 37 | ## User Service API Guide
|
38 | 38 |
|
|
42 | 42 |
|
43 | 43 | - HTTP Method: `POST`
|
44 | 44 |
|
45 |
| -- Endpoint: http://localhost:3001/users |
| 45 | +- Endpoint: http://localhost:8082/users |
46 | 46 |
|
47 | 47 | - Body
|
48 | 48 | - Required: `username` (string), `email` (string), `password` (string)
|
|
72 | 72 |
|
73 | 73 | - HTTP Method: `GET`
|
74 | 74 |
|
75 |
| -- Endpoint: http://localhost:3001/users/{userId} |
| 75 | +- Endpoint: http://localhost:8082/users/{userId} |
76 | 76 |
|
77 | 77 | - Parameters
|
78 | 78 | - Required: `userId` path parameter
|
79 |
| - - Example: `http://localhost:3001/users/60c72b2f9b1d4c3a2e5f8b4c` |
| 79 | + - Example: `http://localhost:8082/users/60c72b2f9b1d4c3a2e5f8b4c` |
80 | 80 |
|
81 | 81 | - <a name="auth-header">Headers</a>
|
82 | 82 |
|
|
104 | 104 |
|
105 | 105 | - This endpoint allows retrieval of all users' data from the database.
|
106 | 106 | - HTTP Method: `GET`
|
107 |
| -- Endpoint: http://localhost:3001/users |
| 107 | +- Endpoint: http://localhost:8082/users |
108 | 108 | - Headers
|
109 | 109 | - Required: `Authorization: Bearer <JWT_ACCESS_TOKEN>`
|
110 | 110 | - Auth Rules:
|
|
128 | 128 |
|
129 | 129 | - HTTP Method: `PATCH`
|
130 | 130 |
|
131 |
| -- Endpoint: http://localhost:3001/users/{userId} |
| 131 | +- Endpoint: http://localhost:8082/users/{userId} |
132 | 132 |
|
133 | 133 | - Parameters
|
134 | 134 | - Required: `userId` path parameter
|
|
170 | 170 |
|
171 | 171 | - HTTP Method: `PATCH`
|
172 | 172 |
|
173 |
| -- Endpoint: http://localhost:3001/users/{userId} |
| 173 | +- Endpoint: http://localhost:8082/users/{userId} |
174 | 174 |
|
175 | 175 | - Parameters
|
176 | 176 | - Required: `userId` path parameter
|
|
208 | 208 |
|
209 | 209 | - This endpoint allows deletion of a user and their related data from the database using the user's ID.
|
210 | 210 | - HTTP Method: `DELETE`
|
211 |
| -- Endpoint: http://localhost:3001/users/{userId} |
| 211 | +- Endpoint: http://localhost:8082/users/{userId} |
212 | 212 | - Parameters
|
213 | 213 |
|
214 | 214 | - Required: `userId` path parameter
|
|
235 | 235 |
|
236 | 236 | - This endpoint allows a user to authenticate with an email and password and returns a JWT access token. The token is valid for 1 day and can be used subsequently to access protected resources. For example usage, refer to the [Authorization header section in the Get User endpoint](#auth-header).
|
237 | 237 | - HTTP Method: `POST`
|
238 |
| -- Endpoint: http://localhost:3001/auth/login |
| 238 | +- Endpoint: http://localhost:8082/auth/login |
239 | 239 | - Body
|
240 | 240 | - Required: `username` (string), `password` (string)
|
241 | 241 |
|
|
259 | 259 |
|
260 | 260 | - This endpoint allows one to verify a JWT access token to authenticate and retrieve the user's data associated with the token.
|
261 | 261 | - HTTP Method: `GET`
|
262 |
| -- Endpoint: http://localhost:3001/auth/verify-token |
| 262 | +- Endpoint: http://localhost:8082/auth/verify-token |
263 | 263 | - Headers
|
264 | 264 | - Required: `Authorization: Bearer <JWT_ACCESS_TOKEN>`
|
265 | 265 |
|
|
0 commit comments