mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 02:31:04 +01:00
add a small convert net/http.Handler to iris.Handler section at the Routing-middleware
parent
55d42e7d57
commit
2be60fea82
2
Home.md
2
Home.md
|
@ -18,7 +18,7 @@ This wiki is the main source of documentation for **developers** working with (o
|
|||
* [[Dependency Injection|Routing-dependency-injection]]
|
||||
* [[Cookies]]
|
||||
|
||||
> This new wiki is a` Work In Progress` in an effort to centralize the documentation and concepts explanation to a single place.
|
||||
> This new wiki is a `Work In Progress` in an effort to centralize the documentation and concepts explanation into a single place.
|
||||
|
||||
## Runnable Examples
|
||||
|
||||
|
|
|
@ -116,9 +116,16 @@ app.SetExecutionRules(iris.ExecutionRules{
|
|||
})
|
||||
```
|
||||
|
||||
---------------------
|
||||
## Convert `http.Handler/HandlerFunc`
|
||||
|
||||
Any third-party middleware that written for `net/http` is automatic compatible with Iris using the `iris.FromStd(aThirdPartyMiddleware)`. Remember, `ctx.ResponseWriter()` and `ctx.Request()` returns the same `net/http` input arguments for an `http.Handler`. See [here](https://github.com/kataras/iris/tree/master/_examples/convert-handlers) for an example.
|
||||
Any third-party middleware that written for `net/http` is automatic compatible with Iris using the `iris.FromStd(aThirdPartyMiddleware)`. Remember, `ctx.ResponseWriter()` and `ctx.Request()` returns the same `net/http` input arguments for an `http.Handler`.
|
||||
|
||||
- [From func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)](convert-handlers/negroni-like/main.go)
|
||||
- [From http.Handler or http.HandlerFunc](convert-handlers/nethttp/main.go)
|
||||
- [From func(http.HandlerFunc) http.HandlerFunc](convert-handlers/real-usecase-raven/writing-middleware/main.go)
|
||||
|
||||
|
||||
---------------------
|
||||
|
||||
Here is a list of some handlers made specifically for Iris:
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user