A lightweight Node.js weather API service with a beautiful web interface
471
A lightweight, containerized Node.js weather API service with a beautiful web interface. Perfect for learning Docker, API development, and modern web technologies.
# Pull and run the container
docker run -d -p 3000:3000 --name weather-api bidhe1/simple-weather-api:latest
# Access the application
# Web Interface: http://localhost:3000
# API Endpoint: http://localhost:3000/api/weather/london
GET /api/weather/:city
Available Cities: london, paris, tokyo, newyork, sydney
Example:
curl http://localhost:3000/api/weather/london
Response:
{
"city": "london",
"temperature": 15,
"condition": "Cloudy",
"humidity": 78,
"timestamp": "2025-06-08T10:30:00.000Z"
}
GET /health
docker run -p 3000:3000 bidhe1/simple-weather-api
docker run -p 8080:3000 -e PORT=3000 bidhe1/simple-weather-api
version: '3.8'
services:
weather-api:
image: bidhe1/simple-weather-api:latest
ports:
- "3000:3000"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
node:18-alpine (secure & lightweight)| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Server port |
# Quick test - get London weather
docker run --rm -p 3000:3000 bidhe1/simple-weather-api &
sleep 5
curl http://localhost:3000/api/weather/london
Repository: https://hub.docker.com/r/bidhe1/simple-weather-api
💡 This is a demonstration project with mock data made for devops ex 11.5 of mooc.fi
Content type
Image
Digest
sha256:be0e5daf2…
Size
46.2 MB
Last updated
over 1 year ago
docker pull bidhe1/simple-weather-api