-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.json
58 lines (51 loc) · 1.41 KB
/
setup.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
// serve files from html/ subdir
"GET html/":{
"handler": "serveDir",
"dropParams": true
},
// allways return status 404 for paths starting /404
"GET 404 | POST 404":{
"handler":"headers",
"dumpRequest": true,
"status":404
},
// wait for 3 secs and serve given data (templated by parameter x) for paths starting /slow/
"GET slow/":{
"handler": "serveString",
"headers":{"Content-Type": "text/html; charset=utf-8"},
"delay": 3.0,
"serve": "<html><body>Slow, isn't it?<br>x='%(x)s'</body></html>",
"template":{"x":"[not set]"}
},
// proxy image
"GET christ-mocked.jpg":{
"handler": "proxy",
"dumpRequest": true,
"URL": "http://www.access-jesus.com/images/christ-mocked.jpg"
},
// check request GET/POST params (returns just headers)
"POST paramcheck | GET paramcheck":{
"handler": "headers",
"status":200,
"checkParams":{
"x":"int,required",
"y":"int",
"s":"string",
"f":"float,required"
}
},
// dump every request for path starting /dump (both POST and GET methods)
"GET dump | POST dump":{
"handler":"dump"
},
// return template.html templated by GET/POST args, defining default 'name' value
"POST template":{
"handler": "serveFile",
"serve": "template.html",
"template":{"name":"Impostor User"}
},
// otherwise serve index.html file from current directory
"GET":{
"handler": "serveFile",
"serve": "index.html"
}