- Clone the project repository.
- Install Node.js and MongoDB on your system.
- Open the project folder in your preferred code editor.
- Run
npm installto install the dependencies. - Start your local MongoDB server.
- Modify the MongoDB connection string in
server.jsif necessary. - Run
node server.jsto start the server. - Use Postman to test the API endpoints mentioned in the task description.
This is a simple API for managing product inventory in an ecommerce platform. It is built using Node.js and MongoDB.
- Add products to the database
- List products
- Delete products
- Update product quantity
- Node.js
- MongoDB
- Clone the repository:
git clone https://github.com/Rdx-coder/Ecommers-API.git"
- Install dependencies:
cd ecommerce-api npm install
-
Set up MongoDB:
- Make sure you have MongoDB installed and running on your local machine or provide the connection string for a remote MongoDB server in the
.envfile.
- Make sure you have MongoDB installed and running on your local machine or provide the connection string for a remote MongoDB server in the
-
Start the server: npm start
-
Use Postman or any other HTTP client to test the API endpoints.
Folder Structure
- models/ # Database models
- controllers/ # API controllers
- routes/ # API routes
- views/ # EJS views
- public/ # Static files (CSS, images, etc.)
- styles.css # CSS styles for the views
- server.js # Server entry point
License This project is licensed under the MIT License. Feel free to use and modify it according to your needs.
You can modify this template according to your specific project requirements and provide additional information or instructions as needed.