Serves server time and weather data for multiple locations, plus Docker host status.
GET /time{
"iso": "2025-06-08T17:47:00.000Z",
"locale": "6/8/2025, 1:47:00 PM",
"timestamp": 1749419220000
}
GET /weather/all[
{
"id": 0,
"location": "Portland, ME",
"data": {
"location": {…},
"current": {…}
}
},
…
]
GET /weather/:id (numeric only)GET /weather/fresh/:idGET /docker/liststateid, names, image, state, status, created, and ports mappings.
POST /sendemailx-auth: 7**9*******9{
"to": "[email protected]",
"Subject": "Hello",
"Body": "Hi! (HTML or plain text)",
"timedelay": 30 // seconds (optional; 0 or omitted = immediate)
}
Returns either { "status":"sent", "messageId":"...", "accepted":[...], "rejected":[...] }
or { "status":"scheduled", "id":"...", "willSendInSeconds": N }.
Create a .env file (not checked into Git):
PORT=3000
WEATHER_API_KEY=your_weatherapi_key
WEATHER_LOCATIONS=Portland, ME|Wallkill, NY|Hollis Center, ME
REFRESH_INTERVAL_MS=600000
npm install
npm start
http://localhost:3000 to view this docs page.docker build -t weather-time-api:latest .
This lets /docker/liststate inspect your other containers.
docker run -d \
--name weather-time-api \
-p 3000:3000 \
-v \\.\pipe\docker_engine:\\.\pipe\docker_engine \
-e DOCKER_SOCKET=\\\\.\\pipe\\docker_engine \
-e WEATHER_API_KEY=6df6a37fc8944aab967191634242209 \
--env WEATHER_LOCATIONS="Portland, ME|Wallkill, NY|Hollis Center, ME|Scarborough, ME|Warwick, NY|Patterson, NY|Fishkill, NY" \
--restart=always \
weather-time-api:latest
curl http://localhost:3000/docker/liststate | jq .