Skip to content

Instantly share code, notes, and snippets.

@natbusa
Created February 10, 2014 21:44
Show Gist options
  • Save natbusa/8924843 to your computer and use it in GitHub Desktop.
Save natbusa/8924843 to your computer and use it in GitHub Desktop.
routing
val serviceRoute = {
pathPrefix("api" / "v1" / "breakfast") {
get {
parameters('eggs.as[Int], 'strips.as[Int], 'slices.as[Int], 'juices.as[Int], 'coffee.as[Int]) {
(friedeggs, baconstrips, breadslices, orangejuices, coffeemugs) =>
complete {
Breakfast(
MainDish(
FriedEggs(friedeggs),
CrispyBacon(baconstrips)),
SideDish(
ToastedBread(breadslices)),
Drinks(
OrangeJuice(orangejuices),
HotCoffee(coffeemugs)))
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment