Browse Source

Fix readme example for updated handler structure

master
Matthew Holt 6 years ago
parent
commit
2141626269
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 11
      README.md

11
README.md

@ -67,10 +67,10 @@ $ curl -X POST "http://localhost:2019/load" \
"listen": ["127.0.0.1:2080"], "listen": ["127.0.0.1:2080"],
"routes": [ "routes": [
{ {
"respond": { "handle": [{
"responder": "file_server", "handler": "file_server",
"browse": {} "browse": {}
} }]
} }
] ]
} }
@ -159,19 +159,18 @@ The following is a non-comprehensive list of significant improvements over Caddy
- All-new HTTP server core - All-new HTTP server core
- Listeners can be configured for any network type, address, and port range - Listeners can be configured for any network type, address, and port range
- Customizable TLS connection policies - Customizable TLS connection policies
- 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. - 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.
- Some matchers are regular expressions, which expose capture groups to placeholders. - Some matchers are regular expressions, which expose capture groups to placeholders.
- New matchers include negation and matching based on remote IP address / CIDR ranges. - New matchers include negation and matching based on remote IP address / CIDR ranges.
- Placeholders are vastly improved generally - Placeholders are vastly improved generally
- Placeholders (variables) are more properly namespaced. - Placeholders (variables) are more properly namespaced.
- Multiple routes may match an HTTP request, creating a "composite route" quickly on the fly. - Multiple routes may match an HTTP request, creating a "composite route" quickly on the fly.
- The actual handler for any given request is its composite route. - The actual handler for any given request is its composite route.
- Only one handler can write to the response, avoiding potential "multiple calls to WriteHeader()" bugs that were too easy in Caddy 1.
- User defines the order of middlewares (careful! easy to break things). - User defines the order of middlewares (careful! easy to break things).
- Adding middlewares no longer requires changes to Caddy's code base (there is no authoritative list). - Adding middlewares no longer requires changes to Caddy's code base (there is no authoritative list).
- Routes may be marked as terminal, meaning no more routes will be matched. - Routes may be marked as terminal, meaning no more routes will be matched.
- Routes may be grouped so that only the first matching route in a group is applied. - Routes may be grouped so that only the first matching route in a group is applied.
- Requests may be "re-handled" if they are modified and need to be sent through the chain again. - Requests may be "re-handled" if they are modified and need to be sent through the chain again (internal redirect).
- Vastly more powerful static file server, with native content-negotiation abilities - Vastly more powerful static file server, with native content-negotiation abilities
- Done away with URL-rewriting hacks often needed in Caddy 1 - Done away with URL-rewriting hacks often needed in Caddy 1
- Highly descriptive/traceable errors - Highly descriptive/traceable errors

Loading…
Cancel
Save