An open API service indexing awesome lists of open source software.

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

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.