No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

35 líneas
721 B

  1. //import Fluent
  2. //import Vapor
  3. //
  4. //func routes(_ app: Application) throws {
  5. // app.get { req async in
  6. // "It works!"
  7. // }
  8. //
  9. // app.get("hello") { req async -> String in
  10. // "Hello, world!"
  11. // }
  12. //
  13. // try app.register(collection: TodoController())
  14. //}
  15. import Vapor
  16. func routes(_ app: Application) throws {
  17. let fuelEntryController = FuelEntryController()
  18. app.get("fuel-entries") { req in
  19. try await fuelEntryController.index(req: req)
  20. }
  21. app.post("fuel-entries") { req in
  22. try await fuelEntryController.create(req: req)
  23. }
  24. app.delete("fuel-entries", ":fuelEntryID") { req in
  25. try await fuelEntryController.delete(req: req)
  26. }
  27. }