A RESTful API to get access to the data in store database.
git clone https://github.com/Justtejas/store-api.git
npm install
- Go to MongoDB Atlas
- Create a Database and a cluster.
- After creating the cluster, Click on
Connect
. - Click on
Connect to your application
. - Copy the url given below.
- Back to the code base directory, Create a
.env
file. - Define variable
MONGO_URI=(The link copied from Mongodb)
- Save the file and follow the steps given below.
npm start
Open your browser and set up localhost:port
localhost:5000//api/v1/products
/api/v1/products?sort=name
/api/v1/products?sort=-name
/api/v1/products?sort=price
/api/v1/products?company=ikea
/api/v1/products?name=e
/api/v1/products?featured=false
limit : /api/v1/products?limit=10
page : /api/v1/products?limit=5&page=2
fields : /api/v1/products?fields=price,name
numericFilters : /api/v1/products?numericFilters=price>=40,rating=4