summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/starlarkmw/example
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2019-10-10 11:27:45 -0600
committerGitHub <noreply@github.com>2019-10-10 11:27:45 -0600
commitb38365ff3b6ab8b2c474603fa0603831e7eff2a7 (patch)
tree7a35ea901e4ce8d3fbe028e8fc81bd1f69c6be68 /modules/caddyhttp/starlarkmw/example
parent53dd600b4de0c2b169f1eb4450a0f02950912524 (diff)
parent26cc8837084f9cea6057e9908f0b5bde0eb15d3e (diff)
Merge pull request #2799 from caddyserver/v2-enterprise-merge
v2: Merge enterprise code into open source v2 branch
Diffstat (limited to 'modules/caddyhttp/starlarkmw/example')
-rw-r--r--modules/caddyhttp/starlarkmw/example/caddy.json19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/caddyhttp/starlarkmw/example/caddy.json b/modules/caddyhttp/starlarkmw/example/caddy.json
new file mode 100644
index 0000000..66f9f2c
--- /dev/null
+++ b/modules/caddyhttp/starlarkmw/example/caddy.json
@@ -0,0 +1,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', {'include_root': './includes'})\n\tmidChain = execute([templates])\n\ndef serveHTTP (rw, r):\n\trw.Write('Hello world, from Starlark!')\n"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+} \ No newline at end of file