Updated Converting Add ons to Plugins (markdown)

Matt Holt 2016-06-14 09:47:04 -06:00
parent 58fe31acaf
commit 25b03555a9

@ -66,10 +66,10 @@ c.OnStartup(func() error {
})
```
Instead of returning a middleware, call `cfg.AddMiddleware()` (where cfg is the site config you got earlier) and pass in your middleware instance:
Instead of returning a middleware, call `siteConfig.AddMiddleware()` and pass in your middleware instance:
```go
cfg.AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
siteConfig.AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
handler.Next = next
return handler
})