vipul-zambare006 / scooters-nearby-backend

Backend api to fetch nearby scooters using NodeJs, ExpressJs and MongoDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rest api for fetching nearby scooters using Node, ExpressJs and MongoDB:

Prerequisite

Mongodb setup is required to run this app:

MongoDB for windows

MongoDB for Mac

MongoDB for Linux

Steps to run applications🚀

  1. Checkout project install node_modules

    npm install

  2. Start mongodb service (refer above links)

  3. Start node application which will start web server at localhost:3000

    npm start

  4. To insert sample locations points of scooters call api:

    http://localhost:3000/api/create-test-locations

  5. UI interface to create more locations based on your preference:

    http://localhost:3000

  6. API to get nearby-scooters:

    http://localhost:3000/api/get-nearby-scooters/:noOfScooters/:latitude/:longitude/:radiusMeters

     Example: http://localhost:3000/api/get-nearby-scooters/6/1.2765707/103.845848/6000
     
     Response format:
     {
           "type":"ScooterCollection",
           "features":[
              {
                 "type":"Scooter",
                 "geometry":{
                    "type":"Point",
                    "coordinates":[
                       103.845848,
                       1.2765707
                    ]
                 }
              }
              ...
           ]
        }
    

Any problems, suggestions?

vipul.zambare1993@gmail.com

About

Backend api to fetch nearby scooters using NodeJs, ExpressJs and MongoDB


Languages

Language:JavaScript 76.5%Language:HTML 23.5%