Skip to content

Instantly share code, notes, and snippets.

@ssuravarapu
Created August 2, 2010 23:26
Show Gist options
  • Save ssuravarapu/505507 to your computer and use it in GitHub Desktop.
Save ssuravarapu/505507 to your computer and use it in GitHub Desktop.
serve {
case "api" :: "user" :: id :: _ Get _ => userDetails(id)
}
serve {
case "api" :: "user" :: id :: _ XmlGet _ => userDetails(id)
case "api" :: "user" :: "add" :: _ XmlPost xml -> _ => addUser(xml)
case x => x match {
case "api" :: "user" :: "update" :: _ XmlPut xml -> _ => updateUser(xml)
case "api" :: "user" :: id :: _ XmlDelete _ => deleteUser(id)
case _ => NotFoundResponse("Bad URI")
}
}
serve {
case "api" :: "user" :: userId :: "address" :: addrId :: _ XmlGet _ => addressDetails(userId, addrId)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment