32 lines
594 B
Go
32 lines
594 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"merch-api/config"
|
|
_ "merch-api/docs"
|
|
"merch-api/internal/app"
|
|
"merch-api/internal/appLog"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// @Title Merch API
|
|
// @Version 2.3
|
|
// @Description Stores data about merch and prices
|
|
// @BasePath /api/v2
|
|
func main() {
|
|
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
|
defer cancel()
|
|
|
|
cfg := config.NewConfig()
|
|
appLog.LogSetup(cfg.App.Mode, cfg.App.LogLvl)
|
|
|
|
appl := app.New(ctx, cfg)
|
|
|
|
if err := appl.Run(ctx); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|