Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
express-mongo-testing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Harshith Karkera
express-mongo-testing
Commits
216a6392
Commit
216a6392
authored
4 months ago
by
Harshith Karkera
Browse files
Options
Downloads
Patches
Plain Diff
API End points file Added
parent
2f21e271
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
API-Endpoints.txt
+90
-0
90 additions, 0 deletions
API-Endpoints.txt
with
90 additions
and
0 deletions
API-Endpoints.txt
0 → 100644
+
90
−
0
View file @
216a6392
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
}
---------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment