Skip to content

Instantly share code, notes, and snippets.

@amolbrid
Created March 27, 2015 16:27
Show Gist options
  • Save amolbrid/78f90b79307d77cbc2e9 to your computer and use it in GitHub Desktop.
Save amolbrid/78f90b79307d77cbc2e9 to your computer and use it in GitHub Desktop.
pathPrefix("advertisers") {
pathEnd {
get {
onSuccess(advertisersService.list) { advs ⇒
complete(advs)
}
} ~
post {
entity(as[JObject]) { jObject ⇒
val advertiser = jObject.extract[Advertiser]
onSuccess(advertisersService.create(advertiser)) { adv ⇒
complete(adv)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment