'created smparkinVaporWeb from template https://github.com/vapor/web-template'
This commit is contained in:
16
Sources/App/routes.swift
Normal file
16
Sources/App/routes.swift
Normal 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)
|
||||
])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user