- build of the plateform
docker-compose up --build
- download of the datasets
docker-compose exec api /bin/bash -c 'flask update-dataset 1'
docker-compose --file docker-compose-db.yml up -d data-integration
- cm-historeno
- db
- added variable environment in the docker-compose
PGDATA: /var/lib/postgresql/data/historeno
host : 127.0.0.1
Port : 5433
Maintenance database : postgres
Username : test (or see .env-db)
DB_PASSWORD : example (or see .env-db)
- generate the json web token, with this tutorial :
- add .postgrest file
PGRST_DB_URI=postgres://test:example@db:5432/dataset
PGRST_DB_ANON_ROLE=api_anon
PGRST_JWT_SECRET=4yHaZ1QtEKmgpR7E295RSs6CdiWyWyjn48DXr3tcLAMawDew5MiFJJLMdDwbc6fi
- Test with simple request
import requests
API_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYXBpX3VzZXIifQ.II34IQz5jIqOnOoAKM7ou9eg8zOxnQqjHhJx0eshfY4"
r = requests.get(
'http://localhost:3000/datasets',
headers={'Authorization': 'Bearer {}'.format(API_KEY)}
)
print(r.url)
response = r.json()
print(response)