Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmathewwws/476e9a2ea9155c3c4157c5c8dcd2b43f to your computer and use it in GitHub Desktop.
Save dmathewwws/476e9a2ea9155c3c4157c5c8dcd2b43f to your computer and use it in GitHub Desktop.
Vapor starter
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