mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-24 02:02:26 -04:00
clarify httpserver.Middleware
parent
493bf501b1
commit
b3dbd6c997
@ -87,7 +87,7 @@ To test that the middleware was set up properly, you'll need to get the config i
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
cfg := httpserver.GetConfig("")
|
cfg := httpserver.GetConfig("")
|
||||||
mids := cfg.Middleware() // []Middleware
|
mids := cfg.Middleware() // []httpserver.Middleware
|
||||||
```
|
```
|
||||||
|
|
||||||
From there, you'll usually want the last middleware in the list, `mids[len(mids)-1]`. If you're not in a loop you can just assume `mids[0]`. Of course, if you didn't add any middleware, you can omit these checks.
|
From there, you'll usually want the last middleware in the list, `mids[len(mids)-1]`. If you're not in a loop you can just assume `mids[0]`. Of course, if you didn't add any middleware, you can omit these checks.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user