-
Clone this repository:
git clone https://github.com/costacis21/margera-weather.git
-
Change directories:
cd margera-weather -
Create a new python environment:
python -m venv venv source venv/bin/activate pip install -r requirements.txt -
Create a Meteomatics API account
-
Create a .env file containing the following variables:
METEOMATICS_USERNAME="YOUR-METEOMATICS-USERNAME" METEOMATICS_PASSWORD="YOUR-METEOMATICS-PASSWORD" DB_PATH="weather.db"
-
Run script
python create_db.py
-
Move to app directory:
cd weatherAPI/src/weatherapi/ -
Run uvicorn webservice:
uvicorn app.main:app --reload
-
Open your browser and go to http://127.0.0.1:8000
-
For documentations head to http://127.0.0.1:8000/docs
> Requires google-cloud-sdk
-
Authenticate with gcloud and set variables
gcloud auth login gcloud config set project PROJECT_ID gcloud config set run/region europe-north1 gcloud auth configure-docker
Must be in this directory
weatherAPI/src/weatherapi/ -
Deploy!
gcloud run deploy sample --port 8080 --source . -
A link will be printed that points to the webservice. If you add /docs to the end of that link, it will prompt you with the relevant documentation