The project assignment for roadmap.sh
URL of the assignment in roadmap.sh:
https://roadmap.sh/projects/weather-api-wrapper-service
This API retrieves weather information about a specific city from a 3rd party
API and sends it back to the user.
It also uses Redis to cache the information.
The 3rd party API used in the project: https://goweather.xyz
-
Clone the repository:
git clone https://github.com/ilia-abbasi/Weather-API.git cd Weather-API -
Install dependencies:
npm install
-
Create the
.envfile in the root of the project and set the variables:PORT=your_port REDIS_HOST=your_redis_host REDIS_PORT=your_redis_port
-
Run the server with:
npm run start
-
Send requests using Postman or a browser. Example URL to send a GET request to:
127.0.0.1:PORT/weather/CITY
ReplacePORTwith the port you set inside the.envfile or the default5000port defined in the source code.
ReplaceCITYwith whatever city you want to get information about, likemoscow.
- axios
- dotenv
- express
- express-rate-limit
- morgan
- redis
The source code is formatted with Prettier.
Read the docs
here.
Weather-API is licensed under the
GPL-3.0 license.