/** * Create a server for the router returned by the given block. * * @param block The block which creates a router. * @param mode The mode the server will run on. * @param port The port the server will run on. * * @return The running server. */ public static Server forRouter(Mode mode, int port, Function<BuiltInComponents, Router> block) { return new Builder() .mode(mode) .http(port) .build(block); }
/** * Create a server for the router returned by the given block. * * @param block The block which creates a router. * @param mode The mode the server will run on. * @param port The port the server will run on. * * @return The running server. */ public static Server forRouter(Mode mode, int port, Function<BuiltInComponents, Router> block) { return new Builder() .mode(mode) .http(port) .build(block); }
/** * Build the server and begin serving the provided routes as configured. * * @param router the router to use. * @return the actively running server. */ public Server build(final Router router) { return build((components) -> router); }
/** * Build the server and begin serving the provided routes as configured. * * @param router the router to use. * @return the actively running server. */ public Server build(final Router router) { return build((components) -> router); }