This is a simple RESTful API for managing products. It provides endpoints for basic CRUD (Create, Read, Update, Delete) operations on products.
- Create Product: Add a new product to the database.
- Read Product: Retrieve information about a specific product or get a list of all products.
- Update Product: Modify the details of an existing product.
- Delete Product: Remove a product from the database.
- Node.js: JavaScript runtime environment.
- Express.js: Web application framework for Node.js.
- MongoDB: NoSQL database for storing product data.
- Mongoose: MongoDB object modeling for Node.js.
- Node.js installed on your machine
- MongoDB installed and running locally or on a remote server
- Clone the repository
git clone https://github.com/<username>/crud-API.git
- Install dependencies
cd crud-API
npm install
- Start the server
npm run dev
- GET /products: Fetch all products.
- GET /products/:id: Fetch a product by ID.
- POST /products: Create a new product.
- PUT /products/:id: Update a product by ID.
- DELETE /products/:id: Delete a product by ID.