How to match on multiple paths?

You can use the | operator in a pattern match:

case GET() -> (Path("hello") | Path("hello-world")) =>
  ...

You can always check the Scala docs for more help.


If you want to handle all paths that start with "my-prefix/":

case GET() -> Path("my-prefix", segments*) =>
  ...

If you want to handle all possible paths:

case GET() -> Path(segments*) =>
  ...