forked from apps/featurer
43 lines
769 B
Go
43 lines
769 B
Go
package main
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"go.dev.pztrn.name/featurer/server/internal/application"
|
|
"go.dev.pztrn.name/featurer/server/internal/services/core/datastore"
|
|
)
|
|
|
|
func main() {
|
|
_ = slog.SetLogLoggerLevel(slog.LevelDebug)
|
|
|
|
app := application.New()
|
|
|
|
slog.Info(
|
|
"Launching Featurer server...",
|
|
"version", application.Version,
|
|
"build", application.Build,
|
|
"branch", application.Branch,
|
|
"commit", application.Commit,
|
|
"build date", application.BuildDate,
|
|
)
|
|
|
|
// Initializing core services first.
|
|
checkError(datastore.Initialize(app))
|
|
|
|
// Then - features services.
|
|
|
|
// Start application.
|
|
checkError(app.Start())
|
|
|
|
<-app.GetShutdownDoneChannel()
|
|
slog.Info("Featurer stopped.")
|
|
}
|
|
|
|
func checkError(err error) {
|
|
if err == nil {
|
|
return
|
|
}
|
|
|
|
panic(err)
|
|
}
|