alpha: v0.0.1
This commit is contained in:
24
xtest/panic/main.go
Normal file
24
xtest/panic/main.go
Normal file
@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/loveuer/nf"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := nf.New(nf.Config{
|
||||
DisableRecover: true,
|
||||
})
|
||||
|
||||
app.Get("/hello/:name", func(c *nf.Ctx) error {
|
||||
name := c.Param("name")
|
||||
|
||||
if name == "nf" {
|
||||
panic("name is nf")
|
||||
}
|
||||
|
||||
return c.JSON("nice")
|
||||
})
|
||||
|
||||
log.Fatal(app.Run("0.0.0.0:80"))
|
||||
}
|
5
xtest/panic/panic.http
Normal file
5
xtest/panic/panic.http
Normal file
@ -0,0 +1,5 @@
|
||||
### panic test
|
||||
GET http://127.0.0.1/hello/nf
|
||||
|
||||
### if covered?
|
||||
GET http://127.0.0.1/hello/world
|
Reference in New Issue
Block a user