/
settings.json
86 lines (86 loc) · 1.76 KB
/
settings.json
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
83
84
85
86
[
{
"name": "minimal setting example",
"port": 9997
},
{
"name": "various routing example",
"port": 9998,
"defaultStatusCode": 404,
"defaultContentType": "application/json",
"defaultResBody": {
"message": "This is default response."
},
"mappings": [
{
"req": {
"method": "POST",
"path": "/foo"
},
"res": {
"statusCode": 201,
"contentType": "text/plain",
"body": "success"
}
},
{
"priority": 1,
"req": {
"path": "/bar"
},
"res": {
"statusCode": 200,
"contentType": "application/json",
"body": {
"response": "/bar accessed."
}
}
},
{
"priority": 2,
"req": {
"method": "PUT",
"path": "/bar"
},
"res": {
"statusCode": 200,
"contentType": "application/json",
"body": "PUT /bar requested."
}
},
{
"req": {
"method": "*",
"path": "/wild/card1/v*/foo"
},
"res": {
"statusCode": 200,
"contentType": "text/plain",
"headers": {
"X-TEST1-HEADER": "test1-header-value",
"X-TEST2-HEADER": "test2-header-value"
},
"body": "single wildcard path used."
}
},
{
"req": {
"path": "/wild/**end"
},
"res": {
"statusCode": 200,
"contentType": "text/plain",
"body": "deep wildcard path used."
}
}
]
},
{
"name": "TLS example",
"port": 9999,
"tls": {
"key": "certs/server.key",
"cert": "certs/server.crt"
}
}
]