This is a API service in NodeJS to demonstrate a simple proxy service to the open weather API with support for caching and ratelimiting. All the required values for ratelimiting and caching are configuration driven via config
directory.
Caching is LRU but in a real deployment use distributed in-memory cachers like Redis.
The service can be easily extended to support any backend API service by writing a client that extends the api base client.
Install Git and NodeJs v6 or above
Setup:
git clone 'this repo'
npm install
> node app/server.js
The tests are written using a BDD. NodeJS has an extensive library collection to support BDD. This repo uses mocha, assert, should and Sinon.
> grunt unit-test
> ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha ./test/**/*.test.js -- -R spec
The server runs default on 8009 port localhost.
http://localhost:8009/weather/country/au/city/melbourne?api_key=<your apikey>