Files
monthly-report-kit/examples/curl-render.sh
T
2026-06-24 14:40:43 +00:00

15 lines
424 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${BASE_URL:-http://localhost:8080}"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
mkdir -p "$ROOT_DIR/output"
curl -sS \
--request POST "$BASE_URL/render" \
--header 'Content-Type: application/json' \
--data-binary "@$ROOT_DIR/examples/sample-report.json" \
--output "$ROOT_DIR/output/sample-report.pdf"
echo "PDF: $ROOT_DIR/output/sample-report.pdf"