package main import ( "time" "git.akyoto.dev/go/web" ) func main() { s := web.NewServer() s.Get("/", func(ctx web.Context) error { ticker := time.NewTicker(time.Second) for { select { case <-ctx.Request().Context().Done(): return nil case <-ticker.C: ctx.Response().WriteString("Hello\n") ctx.Response().Flush() } } }) s.Run(":8080") }