@Test public void routingAsFilter() throws Exception { TestResponse response = createClient(Main::routingAsFilter).path("/post-endpoint").post(); assertEquals(201, response.status().code()); response = createClient(Main::routingAsFilter).path("/get-endpoint").get(); assertEquals(204, response.status().code()); }
public void routingAsFilter() { Routing routing = Routing.builder() .any((req, res) -> { System.out.println(req.method() + " " + req.path()); req.next(); }) .post("/post-endpoint", (req, res) -> res.status(Http.Status.CREATED_201) .send()) .get("/get-endpoint", (req, res) -> res.status(Http.Status.NO_CONTENT_204) .send("Hello World!")) .build(); startServer(routing); }
Main { public void routingAsFilter() { Routing routing = Routing.builder() .any((req, res) -> { System.out.println(req.method() + " " + req.path()); req.next(); }) .post("/post-endpoint", (req, res) -> res.status(Http.Status.CREATED_201) .send()) .get("/get-endpoint", (req, res) -> res.status(Http.Status.NO_CONTENT_204) .send("Hello World!")) .build(); startServer(routing); } }
Main { public void routingAsFilter() { Routing routing = Routing.builder() .any((req, res) -> { System.out.println(req.method() + " " + req.path()); req.next(); }) .post("/post-endpoint", (req, res) -> res.status(Http.Status.CREATED_201) .send()) .get("/get-endpoint", (req, res) -> res.status(Http.Status.NO_CONTENT_204) .send("Hello World!")) .build(); startServer(routing); }  }
Main { public void routingAsFilter() { Routing routing = Routing.builder() .any((req, res) -> { System.out.println(req.method() + " " + req.path()); req.next(); }) .post("/post-endpoint", (req, res) -> res.status(Http.Status.CREATED_201) .send()) .get("/get-endpoint", (req, res) -> res.status(Http.Status.NO_CONTENT_204) .send("Hello World!")) .build(); startServer(routing); }  void firstRouting(); void routingAsFilter(); void parametersAndHeaders(); void advancedRouting(); void organiseCode(); void readContentEntity(); void mediaReader(); void supports(); void errorHandling(); void help(); void h(); static void main(String[] args); }
Main { public void routingAsFilter() { Routing routing = Routing.builder() .any((req, res) -> { System.out.println(req.method() + " " + req.path()); req.next(); }) .post("/post-endpoint", (req, res) -> res.status(Http.Status.CREATED_201) .send()) .get("/get-endpoint", (req, res) -> res.status(Http.Status.NO_CONTENT_204) .send("Hello World!")) .build(); startServer(routing); }  void firstRouting(); void routingAsFilter(); void parametersAndHeaders(); void advancedRouting(); void organiseCode(); void readContentEntity(); void mediaReader(); void supports(); void errorHandling(); void help(); void h(); static void main(String[] args);  }