'created smparkinVaporWeb from template https://github.com/vapor/web-template'

This commit is contained in:
Stephen
2019-10-31 16:50:33 -07:00
commit 931b897f65
22 changed files with 436 additions and 0 deletions

16
Sources/App/routes.swift Normal file
View File

@@ -0,0 +1,16 @@
import Vapor
/// Register your application's routes here.
public func routes(_ router: Router) throws {
// "It works" page
router.get { req in
return try req.view().render("welcome")
}
// Says hello
router.get("hello", String.parameter) { req -> Future<View> in
return try req.view().render("hello", [
"name": req.parameters.next(String.self)
])
}
}