summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/starlarkmw/example/caddy.json
blob: 9479d17d0ec587b8c57aef6c0ca2d1b8058e0895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
	"apps": {
		"http": {
			"servers": {
				"MY_SERVER": {
					"listen": [":3001"],
					"routes": [
						{
							"handle": {
								"handler": "starlark",
								"script": "def setup(r):\n\t# create some middlewares specific to this request\n\ttemplates = loadModule('http.handlers.templates', {'file_root': './includes'})\n\tmidChain = execute([templates])\n\ndef serveHTTP (rw, r):\n\trw.Write('Hello world, from Starlark!')\n"
							}
						}
					]
				}
			}
		}
	}
}