public class RoutesBuilder extends Object
ComponentRouteLocator
. Generally, this will be auto-wired to assist
in the auto-configuration of routes, for example:
@Bean public ComponentRouteLocator myRoutes(RoutesBuilder routesBuilder) { return routesBuilder.routes() .route("/foo/bar", r -> r.componentId("foo:bar:list")) .route("/foo/bar/create", r -> r.componentId("foo:bar:create")) .route("/foo/bar/:id", r -> r.componentId("foo:bar:update")) .build(); }
Constructor and Description |
---|
RoutesBuilder(org.springframework.context.ConfigurableApplicationContext context) |
public RoutesBuilder(org.springframework.context.ConfigurableApplicationContext context)
public RoutesSpec routes()
Copyright © 2021. All rights reserved.