slapid and player now links when registering

This commit is contained in:
2026-02-17 18:33:22 +11:00
parent e50f855206
commit 103da78f0b
11 changed files with 137 additions and 28 deletions

View File

@@ -17,6 +17,7 @@ import (
"git.haelnorr.com/h/oslstats/internal/embedfs"
"git.haelnorr.com/h/oslstats/internal/server"
"git.haelnorr.com/h/oslstats/internal/store"
"git.haelnorr.com/h/oslstats/pkg/slapshotapi"
)
// Initializes and runs the server
@@ -47,8 +48,15 @@ func run(ctx context.Context, logger *hlog.Logger, cfg *config.Config) error {
return errors.Wrap(err, "discord.NewAPIClient")
}
// Setup Slapshot API
logger.Debug().Msg("Setting up Slapshot API client")
slapAPI, err := slapshotapi.NewSlapAPIClient(cfg.Slapshot)
if err != nil {
return errors.Wrap(err, "slapshotapi.NewSlapAPIClient")
}
logger.Debug().Msg("Setting up HTTP server")
httpServer, err := server.Setup(staticFS, cfg, logger, conn, store, discordAPI)
httpServer, err := server.Setup(staticFS, cfg, logger, conn, store, discordAPI, slapAPI)
if err != nil {
return errors.Wrap(err, "setupHttpServer")
}