A weather api wrapper service is a backend service integrating a third party api with a caching feature through redis. Caching is used here to temporary fetch the data without hitting the api if the same location is searched within the time span of 300 seconds.
- Open two terminals: one in vs code powershell and another in vs code wsl.
npm iin powershell terminalsudo apt install redis-server -ythensudo service redis-server start- Create a .env file where you can mention the API_KEY and the REDIS_URL:
(redis://127.0.0.1:6379) - You may now access the complete function at the endpoint:
http://localhost:9300/temp/with body mentioned:
"city": "YOUR_CITY_NAME"