Artsiom Miklushou
Artsiom Miklushou

Reputation: 754

Getting all PathMatchers from Spray route.

I have a Spray rotue. For example:

val myRoute = (get & path("get_init_data")) { 
    ???
} ~ (post & path("push")) { 
    ???
}

Is it possible to extract all paths that are defined in the route? I need to extract paths names and paths methods.

Upvotes: 1

Views: 75

Answers (1)

Aldo Stracquadanio
Aldo Stracquadanio

Reputation: 6237

The answer is no: spray routes are just functions from RequestContext to Unit and thus they are opaque. You are looking for something that is more common in more web-oriented frameworks.

Upvotes: 1

Related Questions