Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
Fix readme example for updated handler structure
Matthew Holt committed
Jul 12, 2019 at 08:53 UTC
2141626269201d902b736711a808098e6d175cbb
1 file changed
+5
-6
README.md
+5
-6
@@ -67,10 +67,10 @@ $ curl -X POST "http://localhost:2019/load" \
67
"listen": ["127.0.0.1:2080"],
68
"routes": [
69
{
70
- "respond": {
71
- "responder": "file_server",
70
+ "handle": [{
71
+ "handler": "file_server",
72
"browse": {}
73
- }
73
+ }]
74
}
75
]
76
}
@@ -159,19 +159,18 @@ The following is a non-comprehensive list of significant improvements over Caddy
159
- All-new HTTP server core
160
- Listeners can be configured for any network type, address, and port range
161
- Customizable TLS connection policies
162
- - HTTP handlers are configured by "routes" which consist of "match", "apply", and "respond" components. Match matches an HTTP request. Apply applies the specified middleware. Respond is the sole handler which responds to the request.
162
+ - HTTP handlers are configured by "routes" which consist of matcher and handler components. Match matches an HTTP request, and handle defines the list of handlers to invoke as a result of the match.
163
- Some matchers are regular expressions, which expose capture groups to placeholders.
164
- New matchers include negation and matching based on remote IP address / CIDR ranges.
165
- Placeholders are vastly improved generally
166
- Placeholders (variables) are more properly namespaced.
167
- Multiple routes may match an HTTP request, creating a "composite route" quickly on the fly.
168
- The actual handler for any given request is its composite route.
169
- - Only one handler can write to the response, avoiding potential "multiple calls to WriteHeader()" bugs that were too easy in Caddy 1.
169
- User defines the order of middlewares (careful! easy to break things).
170
- Adding middlewares no longer requires changes to Caddy's code base (there is no authoritative list).
171
- Routes may be marked as terminal, meaning no more routes will be matched.
172
- Routes may be grouped so that only the first matching route in a group is applied.
174
- - Requests may be "re-handled" if they are modified and need to be sent through the chain again.
173
+ - Requests may be "re-handled" if they are modified and need to be sent through the chain again (internal redirect).
174
- Vastly more powerful static file server, with native content-negotiation abilities
175
- Done away with URL-rewriting hacks often needed in Caddy 1
176
- Highly descriptive/traceable errors