merch-api/cmd/main.go

32 lines
565 B
Go
Raw Normal View History

2026-02-23 18:18:24 +03:00
package main
2026-02-23 18:34:38 +03:00
import (
"context"
"merch-api/config"
2026-03-01 22:15:10 +03:00
_ "merch-api/docs"
2026-02-23 18:34:38 +03:00
"merch-api/internal/app"
"os"
"os/signal"
"syscall"
2026-03-04 17:02:11 +03:00
log "github.com/sirupsen/logrus"
2026-02-23 18:34:38 +03:00
)
2026-03-01 22:15:10 +03:00
// @Title Merch API
2026-03-04 17:02:11 +03:00
// @Version 2.3
// @Description Stores data about merch and prices
2026-03-01 22:15:10 +03:00
// @BasePath /api/v2
2026-02-23 18:34:38 +03:00
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer cancel()
cfg := config.NewConfig()
2026-02-23 19:33:43 +03:00
config.LogSetup(cfg.App.Mode, cfg.App.LogLvl)
2026-02-23 18:34:38 +03:00
2026-03-04 17:02:11 +03:00
appl := app.New(ctx, cfg)
2026-02-23 18:34:38 +03:00
if err := appl.Run(ctx); err != nil {
log.Fatal(err)
}
}