Improve logging

This commit is contained in:
Andrew-71 2024-10-23 11:26:35 +03:00
parent 57903d4724
commit ca9b6e05b7
10 changed files with 49 additions and 21 deletions

View file

@ -20,6 +20,6 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
// GetVersionApi returns current app version.
func GetVersionApi(w http.ResponseWriter, r *http.Request) {
HandleWrite(w.Write([]byte(config.Info.Version)))
HandleWrite(w.Write([]byte(config.Info.Version())))
w.WriteHeader(http.StatusOK)
}

View file

@ -74,6 +74,5 @@ func Serve() {
r.Handle("/public/*", fs)
slog.Info("🌺 Website working", "port", config.Cfg.Port)
slog.Debug("Debug mode enabled")
log.Fatal(http.ListenAndServe(":"+strconv.Itoa(config.Cfg.Port), r))
}