Skip to content

Commit 90f2613

Browse files
committed
Update main.go
1 parent 80ebb6c commit 90f2613

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

main.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import (
77
"log"
88
"net/http"
99
"os"
10+
"time"
1011

11-
"github.com/go-chi/chi"
12+
"github.com/go-chi/chi/v5"
1213
"github.com/go-chi/cors"
1314
"github.com/joho/godotenv"
1415

@@ -89,8 +90,12 @@ func main() {
8990

9091
router.Mount("/v1", v1Router)
9192
srv := &http.Server{
92-
Addr: ":" + port,
93-
Handler: router,
93+
Addr: ":" + port,
94+
Handler: router,
95+
ReadHeaderTimeout: 10 * time.Second,
96+
ReadTimeout: 15 * time.Second,
97+
WriteTimeout: 15 * time.Second,
98+
IdleTimeout: 60 * time.Second,
9499
}
95100

96101
log.Printf("Serving on port: %s\n", port)

0 commit comments

Comments
 (0)