22 lines
816 B
Bash
22 lines
816 B
Bash
|
|
#!/usr/bin/env bash
|
|||
|
|
set -euo pipefail
|
|||
|
|
|
|||
|
|
# tools-v1/apps-api 开发快速启动脚本
|
|||
|
|
# 用法:bash tools-v1/scripts/dev-start.sh [ENV_FILE]
|
|||
|
|
# 默认为 tools-v1/env/apps-api.development.example
|
|||
|
|
|
|||
|
|
ENV_FILE=${1:-tools-v1/env/apps-api.development.example}
|
|||
|
|
|
|||
|
|
if [ ! -f "$ENV_FILE" ]; then
|
|||
|
|
echo "[ERROR] ENV file not found: $ENV_FILE" >&2
|
|||
|
|
exit 1
|
|||
|
|
fi
|
|||
|
|
|
|||
|
|
# shellcheck disable=SC1090
|
|||
|
|
set -a
|
|||
|
|
source "$ENV_FILE"
|
|||
|
|
set +a
|
|||
|
|
|
|||
|
|
echo "[INFO] Starting apps/api with ENV: $ENV_FILE"
|
|||
|
|
# 注意:在 wwjcloud-nest-v1 目录下启动 apps/api
|
|||
|
|
bash -lc 'NODE_ENV=${NODE_ENV:-development} JWT_SECRET=${JWT_SECRET:-dev-secret} AI_ENABLED=${AI_ENABLED:-true} AUTH_ENABLED=${AUTH_ENABLED:-true} RBAC_ENABLED=${RBAC_ENABLED:-false} GLOBAL_PREFIX=${GLOBAL_PREFIX:-api} QUEUE_ENABLED=${QUEUE_ENABLED:-false} PORT=${PORT:-3001} npm run start -- api'
|