Demo for hapiserver
To adapt to different data, modify the four files
config.jsonorconfig-scripts.jsoncatalog.py, which returns/catalogmetadatainfo.pywhich returns/infometadatadata.pywhich returns the/dataresponse
Unit tests for the demo server in test/ can also be adapted.
git clone https://github.com/hapi-server/server-python-demo
cd server-python-demo
python -m pip install -e .For a standalone server, start using
hapiserver --config hapiserver_demo/config.json --workers 2 --host 0.0.0.0 --port 8675
# or
# hapiserver --config hapiserver_demo/config-scripts.json --workers 2 --host 0.0.0.0 --port 8675and see the comments in hapiserver_demo/*.py for adapting the demo to your data.
hapiserver uses the FastAPI framework to create an ASGI application.
To integrate the HAPI application (HAPI endpoints) into an existing ASGI application, see app.py.
To integrate HAPI endpoints into an existing WSGI application (built using frameworks such as Flask, Bottle, and Django), see server-general-psws, which adds HAPI endpoints to a Django application by converting the HAPI ASGI app to WSGI and combining it with the Django WSGI application.
conda create -n hapiserver-python-3.12-demo python=python3.12 pip
python -m pip install -e '.[test]'
python test/test_server.py