small fix
This commit is contained in:
parent
1a410072c2
commit
14ba148284
2 changed files with 74 additions and 29 deletions
34
api-test/init.sh
Normal file
34
api-test/init.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
export API_KEY="X-api-key: 66db96c6-97c9-419e-ac80-6cf920158844"
|
||||
export URL=http://localhost:1234
|
||||
echo $URL
|
||||
|
||||
echo "Rooms!"
|
||||
for i in A B C D E F G
|
||||
do
|
||||
echo "{ \"id\": \"TM$i\", \"name\": \"Team $i\", \"pin_enc\": \"`echo "PIN$i" | sha256 -x`\" }" \
|
||||
| curl --header "$API_KEY" --json @- $URL/api/room
|
||||
done
|
||||
echo
|
||||
echo "questions!"
|
||||
|
||||
echo "[" > ship.json
|
||||
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
do
|
||||
echo "{ \"index\": $i, \"text\": \"What question number is this? Hint (one more than previous question!)?\" }," >> ship.json
|
||||
done
|
||||
echo "{ \"index\": 14, \"text\": \"What question number is this? Hint (one more than previous question!)?\" }" >> ship.json
|
||||
echo "]" >> ship.json
|
||||
curl --header "$API_KEY" --json @- $URL/api/questions < ship.json
|
||||
rm ship.json
|
||||
echo
|
||||
echo "answers!"
|
||||
echo "[" > ship.json
|
||||
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
do
|
||||
echo "{ \"index\": $i, \"text\": \"The answer to the question is, of course, $i! Keep counting!\" }," >> ship.json
|
||||
done
|
||||
echo "{ \"index\": 14, \"text\": \"The answer to the question is, of course, 14! Keep counting!\"} " >> ship.json
|
||||
echo "]" >> ship.json
|
||||
curl --header "$API_KEY" --json @- $URL/api/answers < ship.json
|
||||
rm ship.json
|
||||
Loading…
Add table
Add a link
Reference in a new issue