2023-04-17 05:00:34 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
"github.com/spf13/viper"
|
2023-04-17 08:48:09 +03:00
|
|
|
"gitstore.ru/tolikproh/sirius/internal/model"
|
|
|
|
"gitstore.ru/tolikproh/sirius/internal/server"
|
2023-04-17 05:00:34 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
log.SetFormatter(&log.JSONFormatter{})
|
|
|
|
log.SetOutput(os.Stdout)
|
|
|
|
log.SetLevel(log.WarnLevel)
|
|
|
|
|
2023-04-17 08:48:09 +03:00
|
|
|
if err := model.Init(); err != nil {
|
2023-04-17 05:00:34 +03:00
|
|
|
log.Fatalf("%s", err.Error())
|
|
|
|
}
|
|
|
|
|
2023-04-17 08:48:09 +03:00
|
|
|
app := server.NewApp(viper.GetString("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())
|
|
|
|
}
|
|
|
|
}
|