forked from Fuyu/router
Add middleware
This commit is contained in:
parent
5a44e82541
commit
69754a9946
3 changed files with 127 additions and 65 deletions
18
default.go
Normal file
18
default.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func defaultNotFoundHandler(c *Context) error {
|
||||
return c.String(404, `not found`)
|
||||
}
|
||||
|
||||
func defaultMethodNotAllowedHandler(c *Context) error {
|
||||
return c.String(504, `method not allowed`)
|
||||
}
|
||||
|
||||
func defaultErrorHandler(c *Context, err interface{}) {
|
||||
fmt.Println(err)
|
||||
c.String(500, `internal server error`)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue