Deploy the API
Deploy
with docker
Then access api at http://localhost:5000
with docker-compose
version: "3.9"
services:
boaviztapi:
image: ghcr.io/boavizta/boaviztapi:latest
environment:
- SPECIAL_MESSAGE="<p>my welcome message in HTML format</p>"
ports:
- "5000:5000"
boaviztapi-doc:
image: ghcr.io/boavizta/boaviztapi-doc:latest
environment:
- API_URL=http://boaviztapi_url.com
ports:
- "8080:8080"
with pip
boaviztapi pip package : https://pypi.org/project/boaviztapi/
from source
Prerequisite
Python 3, pipenv recommended
clone the repo
Setup pipenv
Install pipenv globally
Install dependencies and create a python virtual environment.
Launch a development server
Once in the pipenv environment
Development server uses uvicorn and fastapi, you can launch development server with the uvicorn
CLI.
CORS
By default, all origin are allowed. If you need to limit them set env value ALLOWED_ORIGINS
with the following format : ALLOWED_ORIGINS = '["url1", "url2", ...]'
Example : ALLOWED_ORIGINS='["https://datavizta.boavizta.org","https://boavizta.org"]'
Special message
You can customize the home page with a special message by setting the env value `SPECIAL_MESSAGE
in HTML format.
Example : SPECIAL_MESSAGE="<p>my welcome message in HTML format</p>"
SDK
python-sdk : https://pypi.org/project/boaviztapi-sdk/