diff --git a/API-Endpoints.txt b/API-Endpoints.txt new file mode 100644 index 0000000000000000000000000000000000000000..1548b57af29e2701b97e47b1a70de770f6b56272 --- /dev/null +++ b/API-Endpoints.txt @@ -0,0 +1,90 @@ +API Endpoints + +Run the Project : node server.js +Run the Testing : npm test + +Base URL: http://localhost:3000 + +User APIs + +Create a User + +URL: http://localhost:3000/users + +Endpoint: POST /users + +Description: Creates a new user. + +Request Body (JSON): + +{ + "name": "Vijay Sharma", + "email": "vijay@example.com", + "age": 25 +} + +Response (JSON): + +{ + "_id": "1234567890", + "name": "Vijay Sharma", + "email": "vijay@example.com", + "age": 25 +} + +--------------------------------------------------- + +Get All Users + +URL: http://localhost:3000/users + +Endpoint: GET /users + +Description: Retrieves the list of all users. + +Response (JSON): + +[ + { + "_id": "1234567890", + "name": "Vijay Sharma", + "email": "vijay@example.com", + "age": 25 + }, + { + "_id": "0987654321", + "name": "Sumith", + "email": "sumith@example.com", + "age": 30 + } +] + +----------------------------------------------- + +Update a User + +URL: http://localhost:3000/users/{id} + +Endpoint: PUT /users/:id + +Description: Updates user details by ID. + +Request Body (JSON): + +{ + "name": "Kumar", + "age": 30 +} + +Response (JSON): + +{ + "_id": "1234567890", + "name": "Kumar", + "email": "sumith@example.com", + "age": 30 +} + + +--------------------------------------- +