Rest api for fetching nearby scooters using Node, ExpressJs and MongoDB:
Prerequisite
Mongodb setup is required to run this app:
Steps to run applications🚀
-
Checkout project install node_modules
npm install
-
Start mongodb service (refer above links)
-
Start node application which will start web server at
localhost:3000
npm start
-
To insert sample locations points of scooters call api:
http://localhost:3000/api/create-test-locations
-
UI interface to create more locations based on your preference:
-
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 ] } } ... ] }