From 3423ca6d547b67b4255bd3a36e9a960111fb9f9f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 23 Sep 2025 00:10:44 +0100 Subject: [PATCH] Add `success` and `fail` scripts Signed-off-by: Oliver Davies --- go-api/fail | 12 ++++++++++++ go-api/success | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100755 go-api/fail create mode 100755 go-api/success diff --git a/go-api/fail b/go-api/fail new file mode 100755 index 0000000..3364b29 --- /dev/null +++ b/go-api/fail @@ -0,0 +1,12 @@ +#!/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" diff --git a/go-api/success b/go-api/success new file mode 100755 index 0000000..a9ddcca --- /dev/null +++ b/go-api/success @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source .env + +: "${API_PORT:=8000}" + +curl --silent --show-error --verbose "http://localhost:$API_PORT"