https://github.com/abhisheksinghf/employee-api-crud-api-s-using-node.js-and-mongodb
An API to manage Create, Update, Put , Delete Operations
https://github.com/abhisheksinghf/employee-api-crud-api-s-using-node.js-and-mongodb
Last synced: 8 months ago
JSON representation
An API to manage Create, Update, Put , Delete Operations
- Host: GitHub
- URL: https://github.com/abhisheksinghf/employee-api-crud-api-s-using-node.js-and-mongodb
- Owner: abhisheksinghf
- Created: 2024-05-04T16:37:32.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-04T18:38:39.000Z (over 1 year ago)
- Last Synced: 2024-05-05T17:29:46.242Z (over 1 year ago)
- Language: JavaScript
- Size: 2.71 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Employee-API-CRUD-API-s-Using-Node.js-and-MongoDB
This repository contains a backend application built with Node.js and MongoDB for managing employees. It provides CRUD (Create, Read, Update, Delete) API endpoints for interacting with employee data.
## Getting Started
To run the application locally, follow these steps:
1. Clone the repository to your local machine:
```bash
git clone https://github.com/abhisheksinghf/Employee-API-CRUD-API-s-Using-Node.js-and-MongoDB.git
```
Go to that directory
```bash
cd Employee-API-CRUD-API-s-Using-Node.js-and-MongoDB
```
2. Install dependencies:
```bash
npm install express mongoose body-parser
```
3. Start the server:
```bash
nodemon server
```
The server will start on http://localhost:3000 by default.
## API Endpoints
The following API endpoints are available:
- `GET /api/employees`: Retrieve all employees.
- `GET /api/employees/:id`: Retrieve an employee by ID.
- `POST /api/employees`: Create a new employee.
- `PATCH /api/employees/:id`: Update an employee by ID.
- `DELETE /api/employees/:id`: Delete an employee by ID.
## Postman Collection
A Postman collection is provided (`Employee-API.postman_collection.json`) with pre-configured requests for testing the API endpoints. Import the collection into Postman and execute the requests to interact with the API.
Please make sure to include the `Employee-API.postman_collection.json` file in your repository as mentioned in the README.md.