package http

import (
	"log/slog"
	stdhttp "net/http"
	"time"

	"qycw/go-server/internal/bootstrap"
	"qycw/go-server/internal/config"
)

func NewServer(cfg config.Bootstrap, app *bootstrap.App, logger *slog.Logger) *stdhttp.Server {
	return &stdhttp.Server{
		Addr:              cfg.HTTPAddr,
		Handler:           NewRouter(app, logger),
		ReadHeaderTimeout: 5 * time.Second,
		ReadTimeout:       15 * time.Second,
		WriteTimeout:      30 * time.Second,
		IdleTimeout:       60 * time.Second,
	}
}
