sirius/cmd/apisirius/main.go

28 lines
445 B
Go
Raw Normal View History

2023-04-17 05:00:34 +03:00
package main
import (
"flag"
"fmt"
2023-04-17 05:00:34 +03:00
2023-04-17 08:48:09 +03:00
"gitstore.ru/tolikproh/sirius/internal/server"
2023-04-17 05:00:34 +03:00
)
func main() {
flag.Parse()
2023-04-17 05:00:34 +03:00
cfg, err := initConfig()
if err != nil {
fmt.Printf("Error initializing configs file (configs set default): %s\n", err.Error())
2023-04-17 05:00:34 +03:00
}
log := NewLogger(cfg)
app := server.New(cfg, log)
fmt.Printf("Start server on lister port: %s\n", cfg.Srv.Port)
2023-04-17 05:00:34 +03:00
2023-04-17 08:48:09 +03:00
if err := app.Run(); err != nil {
2023-04-17 05:00:34 +03:00
log.Fatalf("%s", err.Error())
}
}