Skip to content

ilia-abbasi/Weather-API

Repository files navigation

Weather API

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

Installation

  1. Clone the repository:

    git clone https://github.com/ilia-abbasi/Weather-API.git
    cd Weather-API
  2. Install dependencies:

    npm install
  3. Create the .env file in the root of the project and set the variables:

    PORT=your_port
    REDIS_HOST=your_redis_host
    REDIS_PORT=your_redis_port

Usage

  1. Run the server with:

    npm run start
  2. Send requests using Postman or a browser. Example URL to send a GET request to:
    127.0.0.1:PORT/weather/CITY
    Replace PORT with the port you set inside the .env file or the default 5000 port defined in the source code.
    Replace CITY with whatever city you want to get information about, like moscow.

Dependencies

  • 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.

About

A weather API that uses a 3rd party API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors