2021-07-19 10:31:18 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2021-11-30 14:29:10 +00:00
|
|
|
# Sets up Moonstream API server
|
|
|
|
# Expects access to Python environment with the requirements
|
|
|
|
# for this project installed.
|
2021-07-19 10:31:18 +00:00
|
|
|
set -e
|
|
|
|
|
2021-11-30 14:29:10 +00:00
|
|
|
MOONSTREAMAPI_HOST="${MOONSTREAMAPI_HOST:-127.0.0.1}"
|
|
|
|
MOONSTREAMAPI_PORT="${MOONSTREAMAPI_PORT:-7481}"
|
|
|
|
MOONSTREAMAPI_APP_DIR="${MOONSTREAMAPI_APP_DIR:-$PWD}"
|
|
|
|
MOONSTREAMAPI_ASGI_APP="${MOONSTREAMAPI_ASGI_APP:-moonstreamapi.api:app}"
|
|
|
|
MOONSTREAMAPI_UVICORN_WORKERS="${MOONSTREAMAPI_UVICORN_WORKERS:-2}"
|
2021-07-19 10:31:18 +00:00
|
|
|
|
2021-11-30 14:29:10 +00:00
|
|
|
uvicorn --reload \
|
|
|
|
--port "$MOONSTREAMAPI_PORT" \
|
|
|
|
--host "$MOONSTREAMAPI_HOST" \
|
|
|
|
--app-dir "$MOONSTREAMAPI_APP_DIR" \
|
|
|
|
--workers "$MOONSTREAMAPI_UVICORN_WORKERS" \
|
|
|
|
"$MOONSTREAMAPI_ASGI_APP"
|