accesscodes/test-api.sh
2025-12-20 07:47:49 +00:00

28 lines
861 B
Bash
Executable file

#!/bin/bash
# Test script for the player resolver API endpoint
# Start the dev server first with: npm run dev
echo "Testing Java player resolution..."
curl -X POST http://localhost:3000/api/resolve-player \
-H "Content-Type: application/json" \
-d '{"type": "java", "username": "Notch"}' \
| jq .
echo -e "\nTesting Bedrock player resolution..."
curl -X POST http://localhost:3000/api/resolve-player \
-H "Content-Type: application/json" \
-d '{"type": "bedrock", "username": "TestGamertag"}' \
| jq .
echo -e "\nTesting invalid input..."
curl -X POST http://localhost:3000/api/resolve-player \
-H "Content-Type: application/json" \
-d '{"type": "invalid", "username": ""}' \
| jq .
echo -e "\nTesting missing fields..."
curl -X POST http://localhost:3000/api/resolve-player \
-H "Content-Type: application/json" \
-d '{}' \
| jq .