-
Notifications
You must be signed in to change notification settings - Fork 0
/
mockoon.json
250 lines (250 loc) · 12 KB
/
mockoon.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
{
"source": "mockoon:1.11.0",
"data": [
{
"type": "environment",
"item": {
"uuid": "",
"lastMigration": 13,
"name": "Demo API",
"endpointPrefix": "",
"latency": 0,
"port": 3000,
"routes": [
{
"uuid": "",
"documentation": "Generate random body (JSON, text, CSV, etc) with templating",
"method": "get",
"endpoint": "api/hadith",
"responses": [
{
"uuid": "",
"body": "{\n \"text\": \"الجار ثم الدار\",\n \"author\": \"حضرت زهرا سلام الله علیها\",\n \"author_link\": \"http://islamplus.net/hadith/23423\",\n \"resource\":\"کتاب اصول کافی ج 3\",\n \"resource_link\":\"http://islamplus.net/book/23423\",\n \"redirect_url\":\"http://localhost/lavasani/wordpress\"\n}",
"latency": 0,
"statusCode": 200,
"label": "Creates 10 random users, or the amount specified in the 'total' query param",
"headers": [
{
"key": "random",
"value": "true"
},
{
"key": "category",
"value": "ethics"
},
{
"key": "type",
"value": "hadith"
},
{
"key": "calendar",
"value": "true"
},
{
"key": "language",
"value": "fa"
},
{
"key": "redirect_url",
"value": "http://localhost/lavasani/wordpress"
}
],
"filePath": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false
}
],
"enabled": true,
"randomResponse": false
},
{
"uuid": "",
"documentation": "Use multiple responses with rules",
"method": "post",
"endpoint": "content/:param1",
"responses": [
{
"uuid": "",
"body": "{\n \"Rules example\": \"Default response. Served if route param 'param1' is not present.\"\n}",
"latency": 0,
"statusCode": 200,
"label": "Default response",
"headers": [
{
"key": "",
"value": ""
}
],
"filePath": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false
},
{
"uuid": "",
"body": "{\n \"Rules example\": \"Content XYZ. Served if route param 'param1' equals 'xyz'. (See in 'Rules' tab)\"\n}",
"latency": 0,
"statusCode": 200,
"label": "Content XYZ",
"headers": [
{
"key": "",
"value": ""
}
],
"filePath": "",
"sendFileAsBody": false,
"rules": [
{
"target": "params",
"modifier": "param1",
"value": "xyz",
"isRegex": false
}
],
"rulesOperator": "OR",
"disableTemplating": false
},
{
"uuid": "",
"body": "{\n \"Rules example\": \"Content not found. Served if route param 'param1' is not equal to 'xyz'. (See in 'Rules' tab)\"\n}\n",
"latency": 0,
"statusCode": 404,
"label": "Content not found",
"headers": [
{
"key": "",
"value": ""
}
],
"filePath": "",
"sendFileAsBody": false,
"rules": [
{
"target": "params",
"modifier": "param1",
"value": "^(?!.*xyz).*$",
"isRegex": true
}
],
"rulesOperator": "OR",
"disableTemplating": false
}
],
"enabled": true,
"randomResponse": false
},
{
"uuid": "",
"documentation": "Serve a file dynamically depending on the path param 'pageName'.",
"method": "get",
"endpoint": "file/:pageName",
"responses": [
{
"uuid": "",
"body": "",
"latency": 0,
"statusCode": 200,
"label": "Templating is also supported in file path",
"headers": [
{
"key": "Content-Type",
"value": "text/html"
}
],
"filePath": "./page{{urlParam 'pageName'}}.html",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false
}
],
"enabled": true,
"randomResponse": false
},
{
"uuid": "",
"documentation": "Path supports various patterns",
"method": "put",
"endpoint": "path/with/pattern(s)?/*",
"responses": [
{
"uuid": "",
"body": "The current path will match the following routes: \nhttp://localhost:3000/path/with/pattern/\nhttp://localhost:3000/path/with/patterns/\nhttp://localhost:3000/path/with/patterns/anything-else\n\nLearn more about Mockoon's routing: https://mockoon.com/docs/latest/routing",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"filePath": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false
}
],
"enabled": true,
"randomResponse": false
},
{
"uuid": "",
"documentation": "Can Mockoon forward or record entering requests?",
"method": "get",
"endpoint": "forward-and-record",
"responses": [
{
"uuid": "",
"body": "Mockoon can also act as a proxy and forward all entering requests that are not caught by declared routes. \nYou can activate this option in the environment settings ('cog' icon in the upper right corner). \nTo learn more: https://mockoon.com/docs/latest/proxy-mode\n\nAs always, all entering requests, and responses from the proxied server will be recorded ('clock' icon in the upper right corner).\nTo learn more: https://mockoon.com/docs/latest/requests-logging",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"filePath": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false
}
],
"enabled": true,
"randomResponse": false
}
],
"proxyMode": false,
"proxyHost": "",
"https": false,
"cors": true,
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"proxyReqHeaders": [
{
"key": "",
"value": ""
}
],
"proxyResHeaders": [
{
"key": "",
"value": ""
}
]
}
}
]
}