@marcel91200 / caddy Mirror · read-only
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 11, 01:00 UTC

master
caddyfiletest 89 lines 1.27 KB
Raw
1 (common) {
2 route /api/* {
3 respond "api"
4 }
5 }
6
7 &(foo) {
8 import common
9 }
10
11 localhost:9080 {
12 invoke foo
13 }
14 ----------
15 {
16 "apps": {
17 "http": {
18 "servers": {
19 "srv0": {
20 "listen": [
21 ":9080"
22 ],
23 "routes": [
24 {
25 "match": [
26 {
27 "host": [
28 "localhost"
29 ]
30 }
31 ],
32 "handle": [
33 {
34 "handler": "subroute",
35 "routes": [
36 {
37 "handle": [
38 {
39 "handler": "invoke",
40 "name": "foo"
41 }
42 ]
43 }
44 ]
45 }
46 ],
47 "terminal": true
48 }
49 ],
50 "named_routes": {
51 "foo": {
52 "handle": [
53 {
54 "handler": "subroute",
55 "routes": [
56 {
57 "handle": [
58 {
59 "handler": "subroute",
60 "routes": [
61 {
62 "handle": [
63 {
64 "body": "api",
65 "handler": "static_response"
66 }
67 ]
68 }
69 ]
70 }
71 ],
72 "match": [
73 {
74 "path": [
75 "/api/*"
76 ]
77 }
78 ]
79 }
80 ]
81 }
82 ]
83 }
84 }
85 }
86 }
87 }
88 }
89 }