Files
2026-02-07 13:04:04 +01:00

40 lines
1.0 KiB
Bash

#!/bin/bash
# Test Skrift Backend API
BASE_URL="http://localhost:4000"
SESSION_ID="test-$(date +%s)"
echo "=========================================="
echo "Testing Skrift Backend API"
echo "=========================================="
echo -e "\n1. Health Check..."
curl -s "$BASE_URL/health" | python -m json.tool
echo -e "\n\n2. Preview Batch (Single Letter)..."
curl -s -X POST "$BASE_URL/api/preview/batch" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "'"$SESSION_ID"'",
"batchIndex": 0,
"config": {
"font": "tilda",
"letters": [
{
"index": 0,
"format": "a4",
"text": "Hallo [[Vorname]] [[Nachname]],\n\ndein persönlicher Gutscheincode lautet: [[Gutscheincode]]\n\nViele Grüße",
"placeholders": {
"Vorname": "Max",
"Nachname": "Mustermann",
"Gutscheincode": "SAVE20"
}
}
],
"envelopes": []
}
}' | python -m json.tool
echo -e "\n\nDone! Session ID: $SESSION_ID"