lets-go:10.6 timeouts

This commit is contained in:
tamsin johnson 2024-02-07 10:22:32 -08:00
parent 5d582a5971
commit 7479313ee8

View File

@ -73,10 +73,13 @@ func main() {
}
srv := &http.Server{
Addr: *addr,
Handler: app.routes(),
ErrorLog: slog.NewLogLogger(logger.Handler(), slog.LevelError),
TLSConfig: tlsConfig,
Addr: *addr,
Handler: app.routes(),
ErrorLog: slog.NewLogLogger(logger.Handler(), slog.LevelError),
TLSConfig: tlsConfig,
IdleTimeout: time.Minute,
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
}
logger.Info("starting server", slog.String("addr", srv.Addr))