Api made for furniture store with Node.js,Express.js,MongoDB & Mongoose
store.api.video.mp4
GET /api/v1/products
GET /api/v1/products?query=.......
Query | Type | Description |
---|---|---|
name |
string |
fetch similar pattern name |
Query | Type | Description |
---|---|---|
featured |
boolean |
fetch featured/non-featured products |
Query | Type | Description |
---|---|---|
company |
string |
fetch products from company-list(ikea/caressa/liddy/marcos) |
Query | Type | Description |
---|---|---|
sort |
string |
sort products on any basis (eg: name -> ascending order / -name -> descending oder) |
Query | Type | Description |
---|---|---|
fields |
string |
fetch selected fields of products (eg : name,price) |
Query | Type | Description |
---|---|---|
limit |
integer |
limit the fetch quantity of products |
Query | Type | Description |
---|---|---|
page |
integer |
fetch according to page |
Query | Type | Description |
---|---|---|
numericFilters |
conditions |
fetch according to conditions (>,>=,=,<,<=) [eg: price>=40,rating>4.5] |
GET /api/v1/products/static
To run this project, you will need to add the following environment variables to your .env file
MONGO_URI
= mongodb+srv://:@nodeexpressprojects.50qvu.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
PORT
= port no you want to run in
express
npm i express --save
mongoose
npm i mongoose
dotenv
npm i dotenv
nodemon
npm i nodemon
To startup nodemon
npm start
Manual start
node app.js
Explicit port initialization
PORT=<port-no> npm start
PORT=<port-no> node app.js