Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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