Last active
October 26, 2016 03:14
-
-
Save stremsdoerfer/06c4ca57dcd3e999561cf9c2445a168c to your computer and use it in GitHub Desktop.
This file contains 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
//User endpoints | |
extension Route { | |
static let me = Route(path:"/me", method:.get) | |
static let friends = Route(path:"/me/friends") //Default method used is GET | |
static let login = {(email:String, password:String) in //You can define a Route as a closure that takes parameters | |
Route(path:"/login", method:.post, params:["email":email, "password":password])} | |
static let user = {(id:String) in Route(path:"/user/\(id)")} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment