Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add routes method to chain object #786

Closed
jknack opened this issue May 23, 2017 · 0 comments
Closed

Add routes method to chain object #786

jknack opened this issue May 23, 2017 · 0 comments
Milestone

Comments

@jknack
Copy link
Member

jknack commented May 23, 2017

{
  use("*", (req, rsp, chain) -> {
    List<Route> routes = chain.routes();
    assertEquals("f1", routes.get(0).name());
    assertEquals("f2", routes.get(1).name());
    assertEquals("f3", routes.get(3).name());

    chain.next(req, rsp);
  }).name("f1");

  use("/users/**", (req, rsp, chain) -> {
    List<Route> routes = chain.routes();
    assertEquals("f2", routes.get(0).name());
    assertEquals("f3", routes.get(1).name());

    chain.next(req, rsp);
  }).name("f2");

  get("/users", req -> {

  }).name("f3");

}

The routes method give us access to current and next matching routes in the pipeline.

@jknack jknack added this to the 1.1.2 milestone May 23, 2017
@jknack jknack closed this as completed in 8d3c1b0 May 23, 2017
jknack added a commit that referenced this issue May 23, 2017
Add routes method to chain object fix #786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant