-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-api.sh
More file actions
executable file
·39 lines (34 loc) · 1003 Bytes
/
test-api.sh
File metadata and controls
executable file
·39 lines (34 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
if [ -z "$SPRITE_TOKEN" ]; then
echo "❌ SPRITE_TOKEN not set"
exit 1
fi
SPRITE_NAME="simple-test"
echo "Testing Services API directly with curl..."
echo ""
echo "1️⃣ Attempting to create service with exact format from docs:"
curl -v -X PUT \
-H "Authorization: Bearer $SPRITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cmd": "sh",
"args": ["-c", "cd /app && PORT=8080 exec bun run app.ts"],
"http_port": 8080,
"needs": []
}' \
"https://api.sprites.dev/v1/sprites/$SPRITE_NAME/services/hyperstar-app"
echo ""
echo ""
echo "2️⃣ Trying with name in body (even though docs don't show it):"
curl -v -X PUT \
-H "Authorization: Bearer $SPRITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "hyperstar-app",
"cmd": "sh",
"args": ["-c", "cd /app && PORT=8080 exec bun run app.ts"],
"http_port": 8080,
"needs": []
}' \
"https://api.sprites.dev/v1/sprites/$SPRITE_NAME/services/test-with-name"