feat: initial import (exclude templates and runtime temp files)
This commit is contained in:
28
app/scripts/smoke_api.sh
Executable file
28
app/scripts/smoke_api.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
BASE_URL="${1:-https://zc.workyai.cn}"
|
||||
|
||||
require_ok() {
|
||||
local json="$1"
|
||||
if ! printf '%s' "$json" | rg -q '"ok"\s*:\s*true'; then
|
||||
printf 'Smoke failed: expected ok=true, got: %s\n' "$json" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
config_json="$(curl -fsS "$BASE_URL/api/config")"
|
||||
require_ok "$config_json"
|
||||
|
||||
issues_json="$(curl -fsS "$BASE_URL/api/issues?status=active&limit=5")"
|
||||
require_ok "$issues_json"
|
||||
|
||||
parse_json="$(curl -fsS -X POST "$BASE_URL/api/parse" \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data '{"raw_text":"#接龙\n1、营江路揽收现金10万存一年"}')"
|
||||
require_ok "$parse_json"
|
||||
|
||||
history_json="$(curl -fsS "$BASE_URL/api/history/view?limit=5")"
|
||||
require_ok "$history_json"
|
||||
|
||||
echo "Smoke passed: $BASE_URL"
|
||||
Reference in New Issue
Block a user