nf/xtest/basic/main.go

22 lines
302 B
Go
Raw Normal View History

2024-01-12 19:18:33 +08:00
package main
import (
"github.com/loveuer/nf"
"log"
)
func main() {
2024-04-10 11:24:17 +08:00
app := nf.New(nf.Config{})
app.Get("/ok", func(c *nf.Ctx) error {
return c.SendStatus(200)
})
2024-01-12 19:18:33 +08:00
2024-02-20 15:34:00 +08:00
api := app.Group("/api")
api.Get("/1", func(c *nf.Ctx) error {
return c.SendString("nice")
2024-02-01 18:06:07 +08:00
})
log.Fatal(app.Run(":80"))
2024-01-12 19:18:33 +08:00
}