Closed decebals closed 1 year ago
With this very simple modification I can extract the part with routes from Application in custom Router. See below an example using Spring IoC:
Application
Router
@Component public class MyRouter extends DefaultRouter { @Autowired private List<RouteGroup> routeGroups; @Autowired private List<Route> routes; @PostConstruct public void addRoutes() { // ignore icon ignorePaths("/favicon.ico"); // add routes for static content addPublicResourceRoute(); addWebjarsResourceRoute(); // filter that inject some info ANY("/.*", routeContext -> { routeContext.setLocal("version", version); routeContext.next(); }); // add registered routes routeGroups.forEach(this::addRouteGroup); routes.forEach(this::addRoute); GET("/threadDump", new ThreadDumpHandler()); GET("/sysInfo", new SystemInfoHandler()); } }
I also accidentally committed a bug fix in this PR.
With this very simple modification I can extract the part with routes from
Application
in customRouter
. See below an example using Spring IoC: