33 lines
723 B
Go
33 lines
723 B
Go
|
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,
|
||
|
fx.Provide(api.NewRouter),
|
||
|
fx.Provide(NewServer),
|
||
|
fx.Invoke(api.SetupRoutes),
|
||
|
fx.Invoke(func(*http.Server) {}),
|
||
|
).Run()
|
||
|
}
|