public static HttpRoutes routes() { return On.setup().routes(); }
private List<Route> findPublishableRoutes() { // admin zone routes are considered private, don't publish them Set<Route> nonAdmin = setup.routes().allExceptInternal(); return Do.findIn(nonAdmin).all(this::isPublishable); }
@Override public Object call() { List<Object> routes = U.list(); Set<Route> appRoutes = On.setup().routes().allExceptInternal(); Set<Route> internalRoutes = On.setup().routes().allInternal(); internalRoutes.addAll(Admin.setup().routes().allInternal()); routes.add(div(h3("Application routes:"), routesOf(appRoutes, true))); routes.add(div(h3("Internal routes:"), routesOf(internalRoutes, true))); return multi(routes); }
private static HttpHandler from(Setup setup, NParamLambda handler, RouteOptions options) { FastHttp http = setup.http(); HttpRoutes routes = setup.routes();
public static HttpRoutes routes() { return setup().routes(); }
public static HttpRoutes routes() { return setup().routes(); }
static void register(Setup setup, String verb, String path, RouteOptions options, NParamLambda lambda) { HttpHandler handler = HttpHandlers.from(setup, lambda, options); setup.routes().on(verb, path, handler); setup.autoActivate(); }
static void registerStatic(Setup setup, String verb, String path, RouteOptions options, byte[] response) { setup.routes().on(verb, path, new StaticHttpHandler(options, response)); setup.autoActivate(); }
@Override public Object call() throws Exception { List<Object> routes = U.list(); Set<Route> appRoutes = On.setup().routes().allNonAdmin(); Set<Route> adminRoutes = On.setup().routes().allAdmin(); adminRoutes.addAll(Admin.setup().routes().allAdmin()); routes.add(div(h3("Application routes:"), routesOf(appRoutes, true))); routes.add(div(h3("Admin routes:"), routesOf(adminRoutes, true))); return multi(routes); }
static void registerPredefined(Setup setup, String verb, String path, RouteOptions options, Object response) { FastHttp http = setup.http(); HttpRoutes routes = setup.routes(); routes.on(verb, path, new PredefinedResponseHandler(http, routes, options, response)); setup.autoActivate(); }
static void register(Setup setup, String verb, String path, RouteOptions options, Method method, Object instance) { FastHttp http = setup.http(); HttpRoutes routes = setup.routes(); routes.on(verb, path, new MethodReqHandler(http, routes, options, method, instance)); setup.autoActivate(); }
static void register(Setup setup, String verb, String path, RouteOptions options, Callable<?> handler) { FastHttp http = setup.http(); HttpRoutes routes = setup.routes(); routes.on(verb, path, new CallableHttpHandler(http, routes, options, handler)); setup.autoActivate(); }
public static void welcome(Setup setup) { if (!setup.routes().hasRouteOrResource(HttpVerb.GET, "/")) { On.get("/").view("_welcome").zone(CENTER).mvc(new WelcomeHandler()); } }
private static HttpHandler from(Setup setup, NParamLambda handler, RouteOptions options) { FastHttp http = setup.http(); HttpRoutes routes = setup.routes();