ffazil / phtl-weather-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get weather for current location

ffazil opened this issue · comments

  • Round off the Lat-Long to non-decimal place (60mile area) (33.019844 = 33, -96.698883 = -96)
  • If the lat-long is not in the db, create a new db entry and store it
  • Increment request-count for this lat-long in db. Not a good idea. Updating the same record by multiple requests leads to contention and delayed response.
  • If this db entry does not have weather information, fetch weather and store in its entry.
  • Send the reply with weather information from the db entry.
  • If weather data exists for the coordinates in the db, return.
  • If weather data does not exist in the db, fetch data from open weather map API, store and return.
  • Proxied request to OWM ... Implemented
  • Caching ... Implemented
  • Added scripts for Aws EC2.
  • Deployed to EC2.

Attention @RamPattikonda
Access the API via

curl -X GET \
  'http://18.191.193.239/weather?lat=44&lon=-96' \
  -H 'cache-control: no-cache'

Latest code available in feature branch https://github.com/ffazil/phtl-weather-api/tree/feature/phtl-weather-api/issues/1