initial commit. Cloned timetracker repository
This commit is contained in:
41
app/cmd/main.go
Normal file
41
app/cmd/main.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
|
||||
"git.ma-al.com/goc_marek/timetracker/app/delivery/web"
|
||||
"git.ma-al.com/goc_marek/timetracker/app/service/langs"
|
||||
"git.ma-al.com/goc_marek/timetracker/app/utils/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Check for version subcommand
|
||||
versionFlag := flag.Bool("version", false, "Show version information")
|
||||
flag.Parse()
|
||||
|
||||
if *versionFlag {
|
||||
log.Println(version.String())
|
||||
return
|
||||
}
|
||||
|
||||
// Create and setup the server
|
||||
server := web.New()
|
||||
|
||||
// Configure routes
|
||||
if err := server.Setup(); err != nil {
|
||||
log.Fatalf("Failed to setup server: %v", err)
|
||||
}
|
||||
|
||||
// Load translations on startup
|
||||
if err := langs.LangSrv.LoadTranslations(); err != nil {
|
||||
log.Printf("Warning: Failed to load translations on startup: %v", err)
|
||||
} else {
|
||||
log.Println("Translations loaded successfully on startup")
|
||||
}
|
||||
|
||||
// Start the server
|
||||
if err := server.Run(); err != nil {
|
||||
log.Fatalf("Failed to start server: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user