forked from forgejo/forgejo
[TESTS] testMiddlewareHook, dependency injection in integration tests
(cherry picked from commit 6623630d10
)
This commit is contained in:
parent
ae57e1b6d7
commit
d30b9dc5b4
6 changed files with 28 additions and 19 deletions
|
@ -175,12 +175,12 @@ func GlobalInitInstalled(ctx context.Context) {
|
|||
}
|
||||
|
||||
// NormalRoutes represents non install routes
|
||||
func NormalRoutes() *web.Route {
|
||||
func NormalRoutes(middlewares ...any) *web.Route {
|
||||
_ = templates.HTMLRenderer()
|
||||
r := web.NewRoute()
|
||||
r.Use(common.ProtocolMiddlewares()...)
|
||||
|
||||
r.Mount("/", web_routers.Routes())
|
||||
r.Mount("/", web_routers.Routes(middlewares...))
|
||||
r.Mount("/api/v1", apiv1.Routes())
|
||||
r.Mount("/api/forgejo/v1", forgejo.Routes())
|
||||
r.Mount("/api/internal", private.Routes())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue