-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
42 lines (29 loc) · 795 Bytes
/
test.sh
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
40
41
#!/bin/bash
set -x
set -e
ROOT_URL='https://europe-west1-dyad-finder.cloudfunctions.net/dyad'
post() {
curl -X POST -H "Content-Type: application/json" -d"$2" ${ROOT_URL}$1 && echo ""
}
delete() {
curl -X DELETE ${ROOT_URL}$1 && echo ""
}
get() {
curl ${ROOT_URL}$1 && echo ""
}
# get empty group
get '/group/abc'
# create group
post '/group/abc' '{ "members": [ "Arthur", "Jenny" ]}'
# get group with members
get '/group/abc'
# set preferences for Arthur and Jenny
post '/group/abc/preference' '{ "me": "Arthur", "preferences": [ "Jenny" ] }'
post '/group/abc/preference' '{ "me": "Jenny", "preferences": [ "Arthur" ] }'
# get preference data
get '/group/abc/raw_preferences'
# get matches
# Currently not working
get '/group/abc/matches'
# delete group
delete '/group/abc'