create-challenge.sh

#!/bin/sh
SERVER_URL="${SWGY_SERVER:-http://127.0.0.1}"
CURL=/usr/local/bin/curl
# Collect command line arguments
if [ $# -ne 2 ]; then
  echo "Usage: $0 <http-verb> <url-path>"
  exit 1
fi

http_verb=$1
url_path=$2

# Create JSON request body
json_body="{\"path\":\"$http_verb $url_path\"}"

# Make PUT request with curl
$CURL -k -v -X PUT -H "Content-Type: application/json" -d "$json_body" ${SERVER_URL}/api/challenges