unis-oa/backend/scripts/dev-api.sh

9 lines
389 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/env bash
# Start the UnisOA API (schema bootstrap + seed run on boot).
# 本机开发:默认读测试档配置文件(config.toml + config.dev.toml)。
# 想临时换一档:OA_ENV=test ./scripts/dev-api.sh
set -euo pipefail
cd "$(dirname "$0")/.."
export OA_ENV="${OA_ENV:-dev}"
exec python3 -m uvicorn app.main:app --host "${OA_HOST:-0.0.0.0}" --port "${OA_PORT:-8000}"