Commit cdda4e50 authored by Artemis's avatar Artemis

Configured the http.Server block

parent 983afbf8
......@@ -5,6 +5,7 @@ import (
"github.com/spf13/viper"
"log"
"net/http"
"time"
)
func main() {
......@@ -24,6 +25,13 @@ func main() {
}
host := viper.GetString("HttpHost")
srv := &http.Server{
Addr: host,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
Handler: handlers.GetRouter(),
}
fmt.Printf("HTTP server about to start listening on %s\n", host)
log.Fatal(http.ListenAndServe(host, handlers.GetRouter()))
log.Fatal(srv.ListenAndServe())
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment