Initial commit
This commit is contained in:
39
Docker Backend/test-api.sh
Normal file
39
Docker Backend/test-api.sh
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user