Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garyeung/weather_api
This is a weather API that fetches and returns weather data. In this project, instead of relying on our own weather data, we will build a weather API that fetches and returns weather data from a 3rd party API
https://github.com/garyeung/weather_api
expressjs redis-cache typescript weather-api
Last synced: about 2 months ago
JSON representation
This is a weather API that fetches and returns weather data. In this project, instead of relying on our own weather data, we will build a weather API that fetches and returns weather data from a 3rd party API
- Host: GitHub
- URL: https://github.com/garyeung/weather_api
- Owner: garyeung
- License: mit
- Created: 2024-11-04T01:09:12.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T01:52:36.000Z (3 months ago)
- Last Synced: 2024-11-06T02:40:12.514Z (3 months ago)
- Topics: expressjs, redis-cache, typescript, weather-api
- Language: TypeScript
- Homepage: https://roadmap.sh/projects/weather-api-wrapper-service
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Weather_API
## Description
(https://roadmap.sh/projects/weather-api-wrapper-service)
This is a weather API that fetches and returns weather data.
In this project, instead of relying on our own weather data, we will build a weather API that fetches and returns weather data from a 3rd party API.## Prerequisites
```sh
install redis
install npm@latest
```
Register on [Visual Crossing’s API](https://www.visualcrossing.com/weather-api) to get your key or use your favorite API.## Installation
```sh
git clone https://github.com/garyeung/todo_list_API.gitcd todo_list_API
npm install
```## Usage
Make sure your redis server is running
```
npm run build
npm run startGET yourhost/weather/?location="name or lat&long"
```## Mechanism
- Rely the weather data according to the city location of the request including name, latitude & longitude.- If the cache has the current data return it to the client side, otherwise request the Weather API and store the cache.
- Cache have expiration time.
- There is a rate limit to prevent abuse of the API.