This is a Node.js API for managing employees. It provides CRUD (Create, Read, Update, Delete) operations for employees.
-
Clone the repository:
git clone https://github.com/your-username/employee-management-api.git -
Install the dependencies:
cd employee-management-api npm install -
Create a
.envfile in the root of your project directory, and add the following lines to it:MONGODB_URI=mongodb+srv://<username>:<password>@employees.h0qdzzw.mongodb.net/?retryWrites=true&w=majorityReplace
<username>and<password>with your actual MongoDB username and password. -
Start the API server:
npm startThe API server will start running on
http://localhost:5000.
GET /employees
Returns a list of all employees.
GET /employees/:id
Returns a single employee with the specified ID.
POST /employees
Creates a new employee with the specified data.
PATCH /employees/:id
Updates an existing employee with the specified ID.
DELETE /employees/:id
Deletes an employee with the specified ID.
- Node.js
- Express.js
- MongoDB
This project is licensed under the MIT License - see the LICENSE file for details.