lab/go-api/fail

13 lines
207 B
Text
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
source .env
STATUS_CODE="${1:-500}"
: "${API_PORT:=8000}"
curl --silent --show-error --verbose "http://localhost:$API_PORT" \
--header "force-fail: $STATUS_CODE"