-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfillup.sh
More file actions
executable file
·48 lines (43 loc) · 1.84 KB
/
Copy pathfillup.sh
File metadata and controls
executable file
·48 lines (43 loc) · 1.84 KB
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
42
43
44
45
46
47
48
#!/bin/bash
# Set up users
curl -XPOST -d "{ \"name\" : \"Eysteinn\", \"email\" : \"eysteinn13@ru.is\" }" -H "Content-Type: Application/json" http://localhost:3000/api/users
echo
curl -XPOST -d "{ \"name\" : \"Arnar\", \"email\" : \"arnarka13@ru.is\" }" -H "Content-Type: Application/json" http://localhost:3000/api/users
echo
echo "http://localhost:3000/api/users"
curl -XGET http://localhost:3000/api/users
# Set up companies
echo
curl -XPOST -d "{ \"name\" : \"Glo\", \"punchCount\" : 10 }" -H "Content-Type: Application/json" http://localhost:3000/api/companies
echo
curl -XPOST -d "{ \"name\" : \"Serrano\", \"punchCount\" : 10 }" -H "Content-Type: Application/json" http://localhost:3000/api/companies
echo
echo "http://localhost:3000/api/companies"
curl -XGET http://localhost:3000/api/companies
echo
echo "http://localhost:3000/api/companies/0"
curl -XGET http://localhost:3000/api/companies/0
echo
echo "http://localhost:3000/api/companies/3"
curl -XGET http://localhost:3000/api/companies/3
# Adding punches
echo
curl -XPOST -d "{ \"companyId\" : 0 }" -H "Content-Type: Application/json" http://localhost:3000/api/users/0/punches
echo
curl -XPOST -d "{ \"companyId\" : 1 }" -H "Content-Type: Application/json" http://localhost:3000/api/users/0/punches
# Get punches
echo
echo "http://localhost:3000/api/users/0/punches"
curl -XGET http://localhost:3000/api/users/0/punches
echo
echo "http://localhost:3000/api/users/0/punches?company=0"
curl -XGET http://localhost:3000/api/users/0/punches?company=0
echo
echo "http://localhost:3000/api/users/0/punches?company=4"
curl -XGET http://localhost:3000/api/users/0/punches?company=4
echo
echo "http://localhost:3000/api/users/2/punches?company=0"
curl -XGET http://localhost:3000/api/users/2/punches?company=4
echo
echo "http://localhost:3000/api/users/0/punches/0"
curl -XGET http://localhost:3000/api/users/0/punches/0