Hi,
Is there an option to extract uri full without the segments values using ?
simplified example:
val route = get{
path("hello"/Segment/"world"){ segment =>
ctx.complete{
StatusCodes.OK
}
}
}
I am want to collect the Api requests without the segment
def getName(ctx: RequestContext): String = {
???
}val extractor =
mapInnerRoute { route => ctx =>
try {
ctx.complete(getName(ctx))
} catch {
case NonFatal(e) => ctx.complete(s"Got ${e.getClass.getSimpleName}
'${e.getMessage}'")
}
}
val checkedRoute = extractor{
route}
The function getName should return the uri path WITHOUT the segment value
e.g:
"hello.segment.world"
"return api uri without segment value" in {
Get("/hello/beautiful/world") ~> checkedRoute ~> check {
responseAs[String] shouldEqual "hello.segment.world"
}
}
is that possible with mapInnerRoute ? or I have to explicitly implement and
call it in each route ?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.