Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
trait RestService {
implicit val userFormat = jsonFormat2(User)
val userImpl: UserImpl
val route =
post {
path("adduser") {
entity(as[User]) { user =>
val saved: Future[Done] = userImpl.addUser(user)
onComplete(saved) { _ =>
complete("user added")
}
}
}
}
}
class RestServiceImpl extends RestService {
val userImpl = UserImpl
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment