17 lines
416 B
Swift
17 lines
416 B
Swift
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)
|
|
])
|
|
}
|
|
}
|