routes.swift 310 B

1234567891011121314
  1. import Fluent
  2. import Vapor
  3. func routes(_ app: Application) throws {
  4. app.get { req async throws in
  5. try await req.view.render("index", ["title": "Hello Vapor!"])
  6. }
  7. app.get("hello") { req async -> String in
  8. "Hello, world!"
  9. }
  10. try app.register(collection: TodoController())
  11. }