package main

import (
	"net/http"
	"time"

	"github.com/rs/zerolog"
	"github.com/rs/zerolog/log"
)

func main() {
	zerolog.TimeFieldFormat = time.DateTime

	server := &http.Server{
		Addr:         "localhost:3000",
		Handler:      newRouter(),
		ReadTimeout:  10 * time.Second,
		WriteTimeout: time.Minute,
	}

	log.Info().Msg("Listening on http://localhost:3000...")
	if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
		log.Error().Msg(err.Error())
		panic(err)
	}
}
