https://productapi-mqf6.onrender.com/products
This is a simple RESTful API for managing products. It allows you to perform CRUD (Create, Read, Update, Delete) operations on products.
- Create a new product
- Retrieve all products
- Retrieve a single product by ID
- Update a product by ID
- Delete a product by ID
- Node.js and npm installed
- MongoDB installed locally or a MongoDB Atlas account
-
Clone the repository:
git clone https://github.com/Shawn2208/Product-API.git
-
Change into the project directory:
cd product-api
- Install dependencies:
npm install
Create a .env file in the root directory and add the following variables:
- Replace the placeholder values with your MongoDB connection details.
PORT=3000 MONGO_URL=mongodb+srv://your-username:[email protected]/your-database
- Start the server:
npm start
Your API will be accessible at http://localhost:3000 (or the port specified in your .env file).
GET /products: Retrieve all products.
GET /products/:id: Retrieve a single 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.
License
This project is licensed under the MIT License.
You can customize based on your specific project details. Make sure to replace placeholders with your actual information. If you have any further questions or modifications, let me know!