aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/app.go
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2023-05-16 11:27:52 -0400
committerGitHub <[email protected]>2023-05-16 15:27:52 +0000
commitcbf16f6d9eb77f37d6eb588ff3e54cfdfddecc21 (patch)
treeef48ed58e9f0374df46cabecd7edf29c2be019e2 /modules/caddyhttp/app.go
parent13a37688dcdc1ffa8e9322dad0bffac0c0c9893a (diff)
downloadcaddy-cbf16f6d9eb77f37d6eb588ff3e54cfdfddecc21.tar.gz
caddy-cbf16f6d9eb77f37d6eb588ff3e54cfdfddecc21.zip
caddyhttp: Implement named routes, `invoke` directive (#5107)v2.7.0-beta.1
* caddyhttp: Implement named routes, `invoke` directive * gofmt * Add experimental marker * Adjust route compile comments
Diffstat (limited to 'modules/caddyhttp/app.go')
-rw-r--r--modules/caddyhttp/app.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go
index 53b57820d..0e02afdd3 100644
--- a/modules/caddyhttp/app.go
+++ b/modules/caddyhttp/app.go
@@ -293,11 +293,19 @@ func (app *App) Provision(ctx caddy.Context) error {
if srv.Errors != nil {
err := srv.Errors.Routes.Provision(ctx)
if err != nil {
- return fmt.Errorf("server %s: setting up server error handling routes: %v", srvName, err)
+ return fmt.Errorf("server %s: setting up error handling routes: %v", srvName, err)
}
srv.errorHandlerChain = srv.Errors.Routes.Compile(errorEmptyHandler)
}
+ // provision the named routes (they get compiled at runtime)
+ for name, route := range srv.NamedRoutes {
+ err := route.Provision(ctx, srv.Metrics)
+ if err != nil {
+ return fmt.Errorf("server %s: setting up named route '%s' handlers: %v", name, srvName, err)
+ }
+ }
+
// prepare the TLS connection policies
err = srv.TLSConnPolicies.Provision(ctx)
if err != nil {