Skip to content

Manishak798/CRUD-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js CRUD Application with APIs 🚀 ✨

This repository contains a simple Node.js CRUD (Create, Read, Update, Delete) application with APIs. This application allows you to perform basic CRUD operations on a collection of items.

Features ⭐⭐

  • Create: Add new items to the collection.
  • Read: Retrieve all items or a specific item from the collection.
  • Update: Update the details of an existing item.
  • Delete: Remove an item from the collection.

Prerequisites 🛠️✨

Before running this application, make sure you have the following installed:

  • Node.js
  • npm (Node Package Manager)
  • MongoDB
  • Mongoose
  • REST APIs
  • nodemon
  • Express

Setup 💻

  1. Clone this repository to your local machine:
git clone https://github.com/your_username/nodejs-crud-app.git
  1. Navigate to the project directory:
cd nodejs-crud-app
  1. Install dependencies:
npm install
  1. Set up your environment variables:

    • Create a .env file in the root directory.

    • Define the following environment variables in the .env file:

      PORT=8080
      MONGODB_URI=your_mongodb_connection_uri
      

      Replace your_mongodb_connection_uri with your MongoDB connection URI.

Usage ✨

  1. Start the server:
npm start index.js
  1. Once the server is running, you can use your preferred API testing tool (e.g., Postman) to interact with the APIs.

API Endpoints 🛠️

  • GET /items: Get all items.
  • GET /items/:id: Get item by ID.
  • POST /items: Create a new item.
  • PUT /items/:id: Update an existing item.
  • DELETE /items/:id: Delete an item by ID.