Skip to content

Commit 69af496

Browse files
committed
2 parents 98970cf + 4f0c932 commit 69af496

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Free Open source REST API built with | Nodejs + Express + Mongodb ⚡️ Made w
1515
- [Support](#Support)
1616
- [Feedback](#Feedback)
1717
- [Run Locally](#Run_Locally)
18+
- [API Reference](#API_Reference)
1819
- [Screenshots](#Screenshots)
1920
- [Environment Variables](#Environment)
2021
- [Deployment](#Deployment)
@@ -34,10 +35,10 @@ Free Open source REST API built with | Nodejs + Express + Mongodb ⚡️ Made w
3435

3536

3637
# Demo
37-
### <a href="https://saddam-next-ecommerce.vercel.app/">Live Demo </a>
38-
### <a href="https://github.com/saddamarbaa/node-express-rest-api"> Back-End API REPO</a>
39-
### <a href="https://saddam-rest-api.herokuapp.com">LIVE API Demo</a>
4038

39+
### <a href="https://saddam-rest-api.herokuapp.com">LIVE API Demo</a>
40+
### <a href="https://github.com/saddamarbaa/Ecommerce-website-next.js-typeScript">Front-End REPO</a>
41+
### <a href="https://saddam-next-ecommerce.vercel.app/">LIVE Webside DEMO </a>
4142
#### Testing Email: testverstion@gmail.com
4243
#### Testing Password: 12345test
4344

@@ -71,6 +72,45 @@ Free Open source REST API built with | Nodejs + Express + Mongodb ⚡️ Made w
7172
- Update User Role
7273

7374

75+
76+
# API_Reference
77+
78+
#### Get all products
79+
80+
```http
81+
GET https://saddam-rest-api.herokuapp.com/api/v1/products
82+
```
83+
84+
| Parameter | Type | Description |
85+
| :-------- | :------- | :------------------------- |
86+
| `limit` | `number` | default= 100 |
87+
| `category` | `string` | default= All Products |
88+
| `page` | `number` | default= 1 |
89+
| `search` | `string` | search string |
90+
| `sortBy` | `string` | default= createdAt |
91+
| `OrderBy` | `string` | default= desc |
92+
93+
94+
#### example (Paginate - Sort - Filter - Full-text search
95+
```http
96+
GET https://saddam-rest-api.herokuapp.com/api/v1/products?page=1&limit=99&sortBy=createdAt&OrderBy=desc&filterBy=category&category=Sports
97+
GET https://saddam-rest-api.herokuapp.com/api/v1/products?page=2&limit=99&sortBy=createdAt&OrderBy=desc&filterBy=category&category=Jewelery
98+
GET https://saddam-rest-api.herokuapp.com/api/v1/products?page=2&limit=99&sortBy=createdAt&OrderBy=desc&filterBy=category&category=Books&search=nodejs
99+
```
100+
101+
#### Get product
102+
103+
```http
104+
GET https://saddam-rest-api.herokuapp.com/api/v1/products/${id}
105+
```
106+
107+
| Parameter | Type | Description |
108+
| :-------- | :------- | :-------------------------------- |
109+
| `id` | `string` | **Required**. Id of product to fetch |
110+
111+
112+
113+
74114
# Environment
75115
- To run this project, you will need to add the following environment variables to your .env file (check environment.config.js file for more examples)
76116

0 commit comments

Comments
 (0)