Files
vapor-po/Sources/App/routes.swift

15 lines
289 B
Swift

import Fluent
import Vapor
func routes(_ app: Application) throws {
app.get { req async throws in
try await req.view.render("index", ["title": "Hello Vapor!"])
}
app.get("hello") { _ async -> String in
"Hello, world!"
}
try app.register(collection: ApiController())
}