refactor: use newRouterConfigBuilder()

This commit is contained in:
2025-11-13 08:07:11 +01:00
parent 2755f727f2
commit 006609545c
2 changed files with 9 additions and 30 deletions

View File

@@ -35,21 +35,11 @@ func setupRateLimitRouter(t *testing.T, rateLimitConfig config.RateLimitConfig)
staticDir := t.TempDir()
router := server.NewRouter(server.RouterConfig{
AuthHandler: authHandler,
PostHandler: postHandler,
VoteHandler: voteHandler,
UserHandler: userHandler,
APIHandler: apiHandler,
AuthService: authService,
PageHandler: nil,
StaticDir: staticDir,
Debug: false,
DisableCache: false,
DisableCompression: false,
DBMonitor: middleware.NewInMemoryDBMonitor(),
RateLimitConfig: rateLimitConfig,
})
router := server.NewRouter(newRouterConfigBuilder().
withIndividualHandlers(authHandler, postHandler, voteHandler, userHandler, apiHandler, authService).
withStaticDir(staticDir).
withRateLimitConfig(rateLimitConfig).
build())
return router, suite
}