This commit is contained in:
loveuer
2024-07-26 17:59:02 +08:00
parent d55c6b1932
commit eea192e385
14 changed files with 250 additions and 22 deletions

View File

@ -24,10 +24,9 @@ func initApp(ctx context.Context) *nf.App {
// for example: app := engine.Group("/api/{project}")
app := engine.Group("/api")
app.Get("/available", func() nf.HandlerFunc {
start := time.Now()
return func(c *nf.Ctx) error {
now := time.Now()
return resp.Resp200(c, nf.Map{"ok": true, "start": start, "now": now, "duration": fmt.Sprint(now.Sub(start))})
return resp.Resp200(c, nf.Map{"ok": opt.OK, "start": opt.Start, "now": now, "duration": fmt.Sprint(now.Sub(opt.Start))})
}
}())