From 5d1c9282df11df289bad0f7fb7600fdec544b698 Mon Sep 17 00:00:00 2001 From: Reindert Vetter Date: Tue, 2 Jun 2020 08:45:10 +0200 Subject: [PATCH] lanvard/lanvard#49 generate url with parameters --- main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 107caef..0fe01c4 100755 --- a/main.go +++ b/main.go @@ -6,13 +6,18 @@ import ( "lanvard/bootstrap" "log" net "net/http" + "time" ) func main() { - net.HandleFunc("/", HandleKernel) - log.Println("Server is ready to handle requests") - if err := net.ListenAndServe(":80", nil); err != nil && err != net.ErrServerClosed { + server := &net.Server{ + Addr: ":80", + Handler: net.HandlerFunc(HandleKernel), + WriteTimeout: 30 * time.Second, + ReadTimeout: 30 * time.Second, + } + if err := server.ListenAndServe(); err != nil && err != net.ErrServerClosed { log.Fatal("Could not listen", err) }