Simple weather API that fetches data from third-party service (WeatherAPI) and in-memory caching via node-cache. Build with Node.js, Hono and zod.
- Node 22
- pnpm
- Clone the repository:
git clone https://github.com/Gylvaris/weather-api.git
cd weather-api
- Install dependencies:
pnpm i
- Create a .env file in the project using content of .env.template:
NODE_ENV=development
API_KEY=xyz #paste your API key here
- Start project with:
pnpm dev
- The API will be available at
http://localhost:3000
- To get weather data for a city, make a GET request to
/weather/:city
, where:city
is the name for the city you want to query. Example:
http://localhost:3000/weather/Warsaw
Inspired by https://roadmap.sh/projects/weather-api-wrapper-service