feat: Initial working api routes.
This commit is contained in:
@@ -2,13 +2,13 @@ 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 { req async throws in
|
||||
try await req.view.render("index", ["title": "Hello Vapor!"])
|
||||
}
|
||||
|
||||
app.get("hello") { req async -> String in
|
||||
"Hello, world!"
|
||||
}
|
||||
app.get("hello") { _ async -> String in
|
||||
"Hello, world!"
|
||||
}
|
||||
|
||||
try app.register(collection: TodoController())
|
||||
try app.register(collection: ApiController())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user