mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-11-02 07:21:02 +00:00
[TESTS] testMiddlewareHook, dependency injection in integration tests
(cherry picked from commit6623630d10) (cherry picked from commitd30b9dc5b4) (cherry picked from commit8e790a65ba) (cherry picked from commit9d98ba7e5c) (cherry picked from commit07fc55a3a7) (cherry picked from commitf9d054d17f) (cherry picked from commitc7dc1e1c7f)
This commit is contained in:
parent
abb350fde8
commit
be69999d30
6 changed files with 28 additions and 19 deletions
|
|
@ -169,12 +169,12 @@ func InitWebInstalled(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