NodeJS and Redis demo for Redis 3 Geo Location query support
- NodeJS v6.11.2 or higher
- Redis 3.2.x
- docker CE / docker-machine (vm) (optional but highly recommended for easiness!)
- Make sure Redis server is up & running
- You can do testing and coverage in this package
/
-> main route/api/v1/drivers
Headers: -USER_ID
, (Required) must be a number Parameters: -latitude
, (Required) +/- 90 degree -longitude
, (Required) +/- 180 degree -radius
, (Optional in meter, default: 500m) -limit
, (Optional, default: 10)
Requirement, docker CE
, boot2docker
or docker-machine
npm install
- Make sure you edit
docker-compose.yml
. docker-compose up
to run everything
NOTE: In docker-machine
, you may need to change REDIS_HOST
to your docker ip address.
- Create
.env
file, see the example in.env.sample
- Fill with your own setup. For example, specify
PORT
,REDIS
, etc
npm run dev
=> Developmentnpm run prod
=> Productionnpm run test
/npm test
=> Testingnpm run lint
=> for lintingnpm run lint:fix
=> for automatically fixing all linting issues
Make sure you have followed Instructions
part. Do the following:
npm install
npm test
The benchmark is performed by generating random lat and long within certain radius.
You can see it in tests/integration/test-simultaneous-drivers-api.js
.
This project uses linter via standard
instead of individual linter via eslint
which troubled in setup.
- Make API swagger docs
- Improve load testing
- Restructure project
- Use better validation strategy for accepting geolocation params request?
- Implement back Nginx as load balancer
Made by Rheza Satria (c) 2016-2017