mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
New: context#NextOr && context#NextOrNotFound and some performance improvements on the awesome https://github.com/kataras/iris/pull/909 pushed a while ago
Former-commit-id: 35dd2ab80b69a5bea6f35f58e636bc11229d9921
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
)
|
||||
import "github.com/kataras/iris"
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
|
||||
// this works as expected now,
|
||||
// will handle *all* expect DELETE requests, even if there is no routes
|
||||
// will handle *all* expect DELETE requests, even if there is no routes.
|
||||
app.Get("/action/{p}", h)
|
||||
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
||||
@@ -20,8 +18,7 @@ func h(ctx iris.Context) {
|
||||
|
||||
func fallbackHandler(ctx iris.Context) {
|
||||
if ctx.Method() == "DELETE" {
|
||||
ctx.Next()
|
||||
|
||||
ctx.NextOrNotFound()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user