Ctrl K
ComunidadGuías…

httpserver.go

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
package main

import (
	"net/http"
	"time"
)

const httpHeaderTimeout = 10 * time.Second

const httpIdleTimeout = 60 * time.Second

func configuredHTTPServer(addr string, handler http.Handler) *http.Server {
	return &http.Server{
		Addr:              addr,
		Handler:           handler,
		ReadHeaderTimeout: httpHeaderTimeout,
		IdleTimeout:       httpIdleTimeout,
	}
}