Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abulfozoljumman/mongoose-express-crud-mastery


https://github.com/abulfozoljumman/mongoose-express-crud-mastery

Last synced: 7 days ago
JSON representation

Awesome Lists containing this project

README

        

## Server Vercel Link

- https://assignment-2-abulfozoljumman.vercel.app/

## Running the Program Locally

1. Clone the repository:

2. Install dependencies:

npm install -y

3. Start the server:

npm run start:dev

4. The server runs at [http://localhost:3000/](http://localhost:3000/)

5. Use a tool like Postman or a web browser to test the API endpoints.

## User Management Functions:

1. **Create a New User**

- API Endpoint: `POST /api/users`

2. **Retrieve a List of All Users**

- API Endpoint: `GET /api/users`

3. **Retrieve a Specific User by ID**

- API Endpoint: `GET /api/users/:userId`

4. **Update User Information**

- API Endpoint: `PUT /api/users/:userId`

5. **Delete a User**
- API Endpoint: `DELETE /api/users/:userId`

## Order Management Functions:

1. **Add New Product in Order**

- API Endpoint: `PUT /api/users/:userId/orders`

2. **Retrieve all orders for a specific user**

- API Endpoint: `GET /api/users/:userId/orders`

3. **Calculate Total Price of Orders for a Specific User**
- API Endpoint: `GET /api/users/:userId/orders/total-price`