Skip to content

Instantly share code, notes, and snippets.

@robhinds
Last active December 18, 2017 16:21
Show Gist options
  • Save robhinds/334096c1e24008ec0194310d20ed51af to your computer and use it in GitHub Desktop.
Save robhinds/334096c1e24008ec0194310d20ed51af to your computer and use it in GitHub Desktop.
class UserRoutes {
this: UserServiceComponent =>
val routes: Route =
getPath("users" / JavaUUID) { uuid =>
respond(userService.getUser(GetUserRequest(None, Some(uuid))))
} ~
getPath("users" / Segment) { handle =>
respond(userService.getUser(GetUserRequest(Some(handle), None)))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment