forked from drierat/kPAX2_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
82 lines (57 loc) · 1.1 KB
/
README.txt
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
% README file
%
% This repo contains the kPAX platform server code
%
% TODO: Inclusion of the files structure
## Start server
You can specify parameters using local environment
MONGODB_URL: the mongodb connection URL
### Execute
```
MONGODB_URL="mongodb://readwrite:[email protected]:21462/kpax2" bin/www
```
## Test Endpoints
### list users GET
http://localhost:3000/user/list
### add user POST
http://localhost:3000/user
BODY
```
{
"login": "[email protected]",
"name": "Daniel Riera"
}
```
RESPONSE
```
{
"login": "[email protected]",
"name": "Daniel Riera",
"created_at": "2016-06-08T06:12:45.841Z",
"updated_at": "2016-06-08T06:12:45.841Z",
"_id": "5757b75df7752041468230eb"
}
```
### list games GET
http://localhost:3000/game/list
### add game POST
http://localhost:3000/user
BODY
```
{
"owner_id": "57546d42ff435e591d083d03",
"name": "game1"
}
```
RESPONSE
```
{
"name": "game2",
"owner": "57546d42ff435e591d083d03",
"status": 0,
"nlikes": 0,
"created_at": "2016-06-08T06:25:03.291Z",
"updated_at": "2016-06-08T06:25:03.291Z",
"_id": "5757ba3f8d7c2e6c46484ac5"
}
```