Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save flandy84/957b048f445d5361074ff4536fabc30c to your computer and use it in GitHub Desktop.
Save flandy84/957b048f445d5361074ff4536fabc30c to your computer and use it in GitHub Desktop.
//matches route https://BASEURL/users/67 but not https://BASEURL/users/H67p
drop.get("users", Int.self) { request, userId in
return "You requested User #\(userId)"
}
//matches route https://BASEURL/players/67 if there is a persisted User in Database with id==67
drop.get("players", User.self) { request, user in
return "You requested \(user.name)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment