13 lines
452 B
Bash
Executable File
13 lines
452 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Requires: npm run start (or dev) on port 8008
|
|
set -euo pipefail
|
|
BASE="${1:-http://127.0.0.1:8008}"
|
|
echo "[http] GET $BASE/api/public/stats"
|
|
code=$(curl -s -o /tmp/stats.json -w "%{http_code}" "$BASE/api/public/stats")
|
|
echo "[http] status $code"
|
|
cat /tmp/stats.json | head -c 400
|
|
echo ""
|
|
echo "[http] GET $BASE/api/wallet (expect 401)"
|
|
code2=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/api/wallet")
|
|
echo "[http] status $code2"
|