/Employee-API-CRUD-API-s-Using-Node.js-and-MongoDB

An API to manage Create, Update, Put , Delete Operations

Primary LanguageJavaScript

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:
git clone https://github.com/abhisheksinghf/Employee-API-CRUD-API-s-Using-Node.js-and-MongoDB.git

Go to that directory

cd Employee-API-CRUD-API-s-Using-Node.js-and-MongoDB
  1. Install dependencies:
npm install express mongoose body-parser
  1. Start the server:
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.