Skip to content

REST API which is giving the data about the products using node, express and mongoDB

License

Notifications You must be signed in to change notification settings

Dharmik3/productsApi

Repository files navigation

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

Products Rest API

This project focusing on the REST API. This API is fully functional with filtering, pagination, sorting and selecting. It's fetching the data from the database and provide the products details, so you can able to use this data on the client side in your projects.

Built With

  • NodeJS
  • Express.js
  • MongoDB

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

  1. Get a MongoDB Atlas Application connection URL at https://www.mongodb.com/home by creating the database.
  2. Clone the repo
    git clone https://github.com/Dharmik3/productsApi.git
  3. Install NPM packages
    npm install
  4. Create .env file and put MongoDB url in .env
    MONGO_URL = ENTER YOUR MONGO URL (without inverted commas);
  5. Run following command in terminal
    npm start

(back to top)

Usage

Now you can test your url on your browser or postman with following url

  http://localhost:4000/api/v1/products/

For more examples, please refer to the live link

If you wants to pass some query parameters then the following is the example

  https://products-myg3.onrender.com/api/v1/products/?sort=name,-price&limit=5&select=name

Below are the query parameter which is passed in the form of key value pair

  • select
  • limit
  • page
  • sort

productsapi1

productsapi2

(back to top)

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Dharmik Patel - @dharmik - dharmikpatel.pepalla@gmail.com

Live Project Link: https://productsapi.up.railway.app/api/v1/products/

(back to top)

About

REST API which is giving the data about the products using node, express and mongoDB

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published