feat: 初始化零工后端代码
This commit is contained in:
11
gig-poc/infrastructure/scripts/export-openapi.sh
Executable file
11
gig-poc/infrastructure/scripts/export-openapi.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
PROJECT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)
|
||||
API_PORT="${API_PORT:-8000}"
|
||||
OUTPUT_PATH="${1:-$PROJECT_DIR/docs/openapi.json}"
|
||||
|
||||
mkdir -p "$(dirname "$OUTPUT_PATH")"
|
||||
curl -fsS "http://127.0.0.1:${API_PORT}/openapi.json" -o "$OUTPUT_PATH"
|
||||
echo "OpenAPI 已导出到: $OUTPUT_PATH"
|
||||
Reference in New Issue
Block a user