2023-04-17 05:00:34 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-04-25 13:06:02 +03:00
|
|
|
"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() {
|
2023-04-25 13:06:02 +03:00
|
|
|
flag.Parse()
|
2023-04-17 05:00:34 +03:00
|
|
|
|
2023-04-25 13:06:02 +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
|
|
|
}
|
|
|
|
|
2023-04-25 13:06:02 +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())
|
|
|
|
}
|
|
|
|
}
|