Last active
January 2, 2017 04:11
-
-
Save flandy84/957b048f445d5361074ff4536fabc30c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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