gitea-github-proxy/cmd/proxy/main.go

35 lines
788 B
Go
Raw Permalink Normal View History

package main
import (
"git.lumeweb.com/LumeWeb/gitea-github-proxy/api"
"git.lumeweb.com/LumeWeb/gitea-github-proxy/config"
"git.lumeweb.com/LumeWeb/gitea-github-proxy/db"
"go.uber.org/fx"
"go.uber.org/fx/fxevent"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"net/http"
)
func main() {
logger, _ := zap.NewDevelopment()
fx.New(
fx.Supply(logger),
fx.WithLogger(func(logger *zap.Logger) fxevent.Logger {
log := &fxevent.ZapLogger{Logger: logger}
log.UseLogLevel(zapcore.InfoLevel)
log.UseErrorLevel(zapcore.ErrorLevel)
return log
}),
config.Module,
db.Module,
2024-02-11 21:30:03 +00:00
fx.Provide(api.NewOauth),
fx.Provide(api.NewRouter),
fx.Provide(NewServer),
fx.Provide(api.NewWebhookManager),
fx.Invoke(api.SetupRoutes),
fx.Invoke(func(*http.Server) {}),
).Run()
}