MCPcopy Create free account
hub / github.com/gotenberg/gotenberg / rootPathMiddleware

Function rootPathMiddleware

pkg/modules/api/middlewares.go:135–143  ·  view source on GitHub ↗

rootPathMiddleware sets the root path in the [echo.Context] under "rootPath". Its value may be used to skip a middleware execution based on a request URI. rootPath := c.Get("rootPath").(string) healthURI := fmt.Sprintf("%s/health", rootPath) // Skip the middleware if it's the health check URI.

(rootPath string)

Source from the content-addressed store, hash-verified

133// return next(c)
134// }
135func rootPathMiddleware(rootPath string) echo.MiddlewareFunc {
136 return func(next echo.HandlerFunc) echo.HandlerFunc {
137 return func(c echo.Context) error {
138 c.Set("rootPath", rootPath)
139 // Call the next middleware in the chain.
140 return next(c)
141 }
142 }
143}
144
145// outputFilenameMiddleware sets the output filename in the [echo.Context]
146// under "outputFilename".

Callers 1

StartMethod · 0.85

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected