maps-service/service.go

33 lines
589 B
Go
Raw Normal View History

package main
import (
"git.itzana.me/strafesnet/data-service/internal/datastore/gormstore"
log "github.com/sirupsen/logrus"
"os"
)
func main() {
// Logger
debug := os.Getenv("DEBUG") == "true"
if debug {
log.SetLevel(log.DebugLevel)
log.SetFormatter(&log.TextFormatter{})
} else {
log.SetLevel(log.InfoLevel)
log.SetFormatter(&log.JSONFormatter{})
log.SetReportCaller(true)
}
log.Info("Starting server...")
// Postgres
2024-11-26 01:19:45 +00:00
db, err := gormstore.New(true)
if err != nil {
log.WithField("error", err).Fatalln("database startup failed")
return
}
2024-11-26 01:19:45 +00:00
rpc(db, debug)
}