|
- //import Fluent
- //import Vapor
- //
- //func routes(_ app: Application) throws {
- // app.get { req async in
- // "It works!"
- // }
- //
- // app.get("hello") { req async -> String in
- // "Hello, world!"
- // }
- //
- // try app.register(collection: TodoController())
- //}
-
- import Vapor
-
- func routes(_ app: Application) throws {
- let fuelEntryController = FuelEntryController()
-
- app.get("fuel-entries") { req in
- try await fuelEntryController.index(req: req)
- }
-
- app.post("fuel-entries") { req in
- try await fuelEntryController.create(req: req)
- }
-
- app.delete("fuel-entries", ":fuelEntryID") { req in
- try await fuelEntryController.delete(req: req)
- }
- }
-
|