Updated Writing a Plugin: HTTP Middleware (markdown)

Matt Holt 2016-07-18 15:57:35 -06:00
parent 92360268bb
commit 915b9436f4

@ -12,12 +12,12 @@ In this tutorial, you will learn:
## How HTTP Middleware Works in Caddy ## How HTTP Middleware Works in Caddy
Check out the [godoc for the httpserver package](http://godoc.org/github.com/mholt/caddy/caddyhttp/httpserver) The two most important types are [httpserver.Handler](https://godoc.org/github.com/mholt/caddy/caddyhttp/httpserver#Handler) and [httpserver.Middleware](https://godoc.org/github.com/mholt/caddy/caddyhttp/httpserver#Middleware). Check out the [godoc for the httpserver package](http://godoc.org/github.com/mholt/caddy/caddyhttp/httpserver). The two most important types are [httpserver.Handler](https://godoc.org/github.com/mholt/caddy/caddyhttp/httpserver#Handler) and [httpserver.Middleware](https://godoc.org/github.com/mholt/caddy/caddyhttp/httpserver#Middleware).
Middleware is a way to chain one handler to another.
Handler is a function that actually handles an HTTP request. Handler is a function that actually handles an HTTP request.
Middleware is a way to chain one handler to another.
Caddy will do all the bookkeeping of setting up an HTTP server for you, but you need to implement these two types. Caddy will do all the bookkeeping of setting up an HTTP server for you, but you need to implement these two types.