nf/example/simple/main.go

22 lines
267 B
Go
Raw Normal View History

2024-01-10 20:26:19 +08:00
package main
import (
"errors"
"log"
"nf"
)
func main() {
app := nf.New()
app.Get("/hello", func(c *nf.Ctx) error {
return c.SendString("world")
})
app.Get("/world", func(c *nf.Ctx) error {
return errors.New("nice")
})
log.Fatal(app.Run(":7733"))
}