LocalhostBunny/cmd/server/main.go

36 lines
616 B
Go
Raw Normal View History

2023-12-01 09:56:06 +01:00
package main
import (
"fmt"
"github.com/rs/zerolog/log"
"gogs.mikescher.com/BlackForestBytes/goext/ginext"
bunny "locbunny"
"locbunny/api"
"locbunny/logic"
2023-12-01 13:44:58 +01:00
"locbunny/webassets"
2023-12-01 09:56:06 +01:00
)
func main() {
conf := bunny.Conf
bunny.Init(conf)
log.Info().Msg(fmt.Sprintf("Starting with config-namespace <%s>", conf.Namespace))
2023-12-01 13:44:58 +01:00
assets := webassets.NewAssets()
app := logic.NewApp(assets)
2023-12-01 09:56:06 +01:00
ginengine := ginext.NewEngine(conf.Cors, conf.GinDebug, true, conf.RequestTimeout)
router := api.NewRouter(app)
appjobs := make([]logic.Job, 0)
app.Init(conf, ginengine, appjobs)
router.Init(ginengine)
app.Run()
}