Skip to content

Commit be7992d

Browse files
committed
docs: added api routes details
Signed-off-by: Abhishek kushwaha <[email protected]>
1 parent d46764f commit be7992d

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

versioned_docs/version-2.0.0/quickstart/express-postgresql-prisma.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,27 @@ The above command will start recording the API calls made to the application and
178178
179179
Make API Calls using [Hoppscotch](https://hoppscotch.io/), [Postman](https://www.postman.com/) or [cURL](https://curl.se/) command. Keploy with capture those calls to generate the test-suites containing testcases and data mocks.
180180
181+
### API Routes
182+
181183
#### Add Task
182184
185+
186+
- **URL:** `/api/v1/task/add`
187+
- **Method:** `POST`
188+
- **Description:** Add a new task.
189+
- **Request Body:**
190+
```json
191+
{
192+
"author": "John Doe",
193+
"title": "Complete the report",
194+
"description": "Complete the quarterly report by end of the week",
195+
"dueDate": "2024-08-01",
196+
"status": "Pending",
197+
"priority": 3
198+
}
199+
```
200+
201+
Using `curl`
183202
```bash
184203
curl -X 'POST' \
185204
'http://localhost:3000/api/v1/task/add' \
@@ -198,6 +217,7 @@ curl -X 'POST' \
198217
199218
#### View All Tasks
200219
220+
Using `curl`
201221
```bash
202222
curl -X 'GET' \
203223
'http://localhost:3000/api/v1/task/view' \
@@ -207,6 +227,15 @@ curl -X 'GET' \
207227
208228
#### View Task by ID
209229
230+
231+
- **URL:** `/api/v1/task/view/:id`
232+
- **Method:** `GET`
233+
- **Description:** Retrieve a specific task by its ID.
234+
- **Request Params:** `id` (task ID)
235+
236+
237+
Using `curl`
238+
210239
```bash
211240
curl -X 'GET' \
212241
'http://localhost:3000/api/v1/task/view/1' \
@@ -216,6 +245,18 @@ curl -X 'GET' \
216245
217246
#### Change Task Priority
218247
248+
- **URL:** `/api/v1/task/change-priority/:id`
249+
- **Method:** `PUT`
250+
- **Description:** Update the priority of a specific task.
251+
- **Request Params:** `id` (task ID)
252+
- **Request Body:**
253+
```json
254+
{
255+
"priority": 3
256+
}
257+
```
258+
259+
Using `curl`
219260
```bash
220261
curl -X 'PUT' \
221262
'http://localhost:3000/api/v1/task/change-priority/1' \
@@ -228,6 +269,23 @@ curl -X 'PUT' \
228269
229270
#### Update Task
230271
272+
- **URL:** `/api/v1/task/update/:id`
273+
- **Method:** `PUT`
274+
- **Description:** Update details of a specific task.
275+
- **Request Params:** `id` (task ID)
276+
- **Request Body:**
277+
```json
278+
{
279+
"author": "John Doe",
280+
"title": "Complete the report",
281+
"description": "Complete the quarterly report by end of the week",
282+
"dueDate": "2024-08-01",
283+
"status": "Pending",
284+
"priority": 3
285+
}
286+
```
287+
288+
Using `curl`
231289
```bash
232290
curl -X 'PUT' \
233291
'http://localhost:3000/api/v1/task/update/2' \
@@ -245,12 +303,19 @@ curl -X 'PUT' \
245303
246304
#### Delete Task
247305
306+
- **URL:** `/api/v1/task/delete/:id`
307+
- **Method:** `DELETE`
308+
- **Description:** Delete a specific task.
309+
- **Request Params:** `id` (task ID)
310+
311+
Using `curl`
248312
```bash
249313
curl -X 'DELETE' \
250314
'http://localhost:3000/api/v1/task/delete/1' \
251315
-H 'accept: application/json'
252316
```
253317
318+
254319
> 🐰 Test Data and Configuration: After recording the interactions, a `keploy` folder will be created containing the recorded test data. Additionally, a `keploy.yml` file will be created as the configuration file.
255320
256321
### Test the Application using Keploy

0 commit comments

Comments
 (0)