This is a simple CRUD (Create, Read, Update, Delete) API built with Node.js, Express, and MongoDB.
To get started with this project, follow these steps:
-
Clone the repository:
git clone https://github.com/pavan-kalyan0412/CRUD_TEST.git
-
Navigate to the project directory:
cd CRUD-API
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your MongoDB connection string. Example:mongo_url=mongodb://localhost:27017/your_database_name
-
Start the server:
npm start
-
The server will start running on http://localhost:3000 by default.
GET /api/products
: Get all products.GET /api/products/:id
: Get a single product by ID.POST /api/products
: Create a new product.PUT /api/products/:id
: Update an existing product by ID.DELETE /api/products/:id
: Delete a product by ID.