Forecast service built on top of Flask
To build docker image:
docker build -t forecast:latest .
To run forecast image standalone:
docker run --name forecast -d -p 8000:5000 --rm forecast:latest
Run containers:
docker-compose up
This example uses HTTPie library for HTTP requests.
First, you need to register a new user:
http POST http://localhost:8000/api/users username=alice password=dog [email protected]
Then, grab the authentication token:
http --auth alice:dog POST http://localhost:8000/api/tokens
This example shows how to get current temperature in Moscow in Celsius units.
For Fahrenheit consider to use F in the unit parameter.
http GET "localhost:8000/api/weather?cityname=Moscow&unit=C" "Authorization:Bearer <your token>"
Get report from database for a given period of time startdate:endate in format %Y-%m-%d %H:%M:%S':
http GET "localhost:8000/api/stats?startdate=Y-%m-%d %H:%M:%S&enddate=Y-%m-%d %H:%M:%S" "Authorization:Bearer <your token>"