Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

30 строки
1.2 KiB

  1. import Fluent
  2. import FluentPostgresDriver
  3. import Vapor
  4. // configures your application
  5. public func configure(_ app: Application) async throws {
  6. // uncomment to serve files from /Public folder
  7. // app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
  8. app.databases.use(.postgres(hostname: "localhost", username: "mcarman", password: "@ng31F@rm0823262", database: "fueling"), as: .psql)
  9. // app.databases.use(.postgres(
  10. // hostname: Environment.get("localhost") ?? "localhost",
  11. // port: Environment.get("5432").flatMap(Int.init(_:)) ?? PostgresConfiguration.ianaPortNumber,
  12. // username: Environment.get("mcarman") ?? "vapor_username",
  13. // //username: Environment.get("bryckman") ?? "vapor_username",
  14. // password: Environment.get("@ng31F@rm0823262" ?? "vapor_password"),
  15. // //password: Environment.get("55H1ck0ry1669") ?? "vapor_password",
  16. // database: Environment.get("fueling") ?? "vapor_database"
  17. // ), as: .psql)
  18. app.http.server.configuration.port = 3001
  19. // app.migrations.add(CreateTodo())
  20. app.migrations.add(CreateFuelEntry())
  21. try await app.autoMigrate().get()
  22. // register routes
  23. try routes(app)
  24. }