Created
July 10, 2017 19:39
-
-
Save dmathewwws/476e9a2ea9155c3c4157c5c8dcd2b43f to your computer and use it in GitHub Desktop.
Vapor starter
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
import Vapor | |
let drop = Droplet() | |
drop.get("welcome") { request in | |
return "Hello" | |
} | |
drop.get("uppercase") { request in | |
guard let word = request.data["word"]?.string else { return "Could not grab the name" } | |
return word.uppercased() | |
} | |
drop.post("user") { request in | |
guard let name = request.data["name"]?.string else { return "Could not grab the name" } | |
return name | |
} | |
drop.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment