-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_routes.http
More file actions
74 lines (57 loc) · 1.76 KB
/
api_routes.http
File metadata and controls
74 lines (57 loc) · 1.76 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
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
################################################################################
# Test file for HTTP routes of the API
# Needs REST Client VSCode addon
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
################################################################################
@endpoint = http://localhost:{{$dotenv PORT}}/api
### 404
GET {{ endpoint }}/ofkjshsekih
#########################
# SENTENCE #
#########################
### Get random sentence (except 1)
GET {{ endpoint }}/sentence
### Get first sentence
GET {{ endpoint }}/sentence/first
#########################
# PLAYER ACCOUNT #
#########################
### Get player account infos
GET {{ endpoint }}/playerAccount/2
### Get wrong player account infos
GET {{ endpoint }}/playerAccount/57
### Insert player account
POST {{ endpoint }}/playerAccount/
content-type: application/json
{
"username": "playerrrr",
"mail": "player@player.com",
"password": "azerty",
"passwordConfirm": "azerty"
}
### Insert wrong player account
POST {{ endpoint }}/playerAccount/
content-type: application/json
{
"username": "playeskejrhzkerhr",
"mail": "player45@player.com",
"password": "azerty",
"passwordConfirm": "azerty2"
}
### Update player account
PATCH {{ endpoint }}/playerAccount/7
content-type: application/json
{
"password": "test2",
"passwordConfirm": "test2"
}
### Post player login (JWT returned)
POST {{ endpoint }}/login
content-type: application/json
{
"mail": "test@mail.fr",
"password": "aaa"
}
### Get player save
GET {{ endpoint }}/save/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NywidXNlcm5hbWUiOiJUZXN0IiwiaWF0IjoxNjQ5MTY0MjQ0LCJleHAiOjE2NDkyNTA2NDR9.ukWh0ymP8aOTObLvaJK1BjQqNNNZ5ulzQK1yTHXmyvY