- cd backend
- npm install
- npm run dev
- PORT
- MONGO_URL
- cd employee-management
- npm install
- npm run dev
GET /v1/getall
Fetches a list of all employees.
"employees": [
{
"id": 1,
"name": "John Doe",
"email": "[email protected]",
"age": 30,
"salary": 50000
},
{
"id": 2,
"name": "Jane Smith",
"email": "[email protected]",
"age": 28,
"salary": 55000
}
]
}
POST /v1/add
Adds a new employee.
{
"name": "Alice Johnson",
"email": "[email protected]",
"age": 35,
"salary": 60000
}
PUT /v1/update/:id
Updates an existing employee's details by their ID.
{
"name": "Alice Cooper",
"email": "[email protected]",
"age": 36,
"salary": 65000
}
DELETE /v1/delete/:id
Deletes an employee by their ID.