| @@ -0,0 +1,68 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <Bucket | |||||
| uuid = "83CCDCAB-5627-45C3-BC68-1A59A1D654E0" | |||||
| type = "1" | |||||
| version = "2.0"> | |||||
| <Breakpoints> | |||||
| <BreakpointProxy | |||||
| BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |||||
| <BreakpointContent | |||||
| uuid = "503D736B-E738-40DF-8DFC-FBACCAF425CE" | |||||
| shouldBeEnabled = "Yes" | |||||
| ignoreCount = "0" | |||||
| continueAfterRunningActions = "No" | |||||
| filePath = "Sources/App/Controllers/FuelEntryV2Controller.swift" | |||||
| startingColumnNumber = "9223372036854775807" | |||||
| endingColumnNumber = "9223372036854775807" | |||||
| startingLineNumber = "30" | |||||
| endingLineNumber = "30" | |||||
| landmarkName = "index(req:)" | |||||
| landmarkType = "7"> | |||||
| <Locations> | |||||
| <Location | |||||
| uuid = "503D736B-E738-40DF-8DFC-FBACCAF425CE - 7e13237d1c18fd17" | |||||
| shouldBeEnabled = "Yes" | |||||
| ignoreCount = "0" | |||||
| continueAfterRunningActions = "No" | |||||
| symbolName = "(1) suspend resume partial function for App.FuelEntryV2Controller.index(req: Vapor.Request) async throws -> Swift.Array<App.FuelEntry>" | |||||
| moduleName = "App" | |||||
| usesParentBreakpointCondition = "Yes" | |||||
| urlString = "file:///Users/mcarman/Projects/Vapor/fueling_v1/Sources/App/Controllers/FuelEntryV2Controller.swift" | |||||
| startingColumnNumber = "9223372036854775807" | |||||
| endingColumnNumber = "9223372036854775807" | |||||
| startingLineNumber = "30" | |||||
| endingLineNumber = "30"> | |||||
| </Location> | |||||
| <Location | |||||
| uuid = "503D736B-E738-40DF-8DFC-FBACCAF425CE - 356e35258358ea8a" | |||||
| shouldBeEnabled = "Yes" | |||||
| ignoreCount = "0" | |||||
| continueAfterRunningActions = "No" | |||||
| symbolName = "(2) await resume partial function for App.FuelEntryV2Controller.index(req: Vapor.Request) async throws -> Swift.Array<App.FuelEntry>" | |||||
| moduleName = "App" | |||||
| usesParentBreakpointCondition = "Yes" | |||||
| urlString = "file:///Users/mcarman/Projects/Vapor/fueling_v1/Sources/App/Controllers/FuelEntryV2Controller.swift" | |||||
| startingColumnNumber = "9223372036854775807" | |||||
| endingColumnNumber = "9223372036854775807" | |||||
| startingLineNumber = "30" | |||||
| endingLineNumber = "30"> | |||||
| </Location> | |||||
| <Location | |||||
| uuid = "503D736B-E738-40DF-8DFC-FBACCAF425CE - bb9b3e6730724091" | |||||
| shouldBeEnabled = "Yes" | |||||
| ignoreCount = "0" | |||||
| continueAfterRunningActions = "No" | |||||
| symbolName = "(3) suspend resume partial function for App.FuelEntryV2Controller.index(req: Vapor.Request) async throws -> Swift.Array<App.FuelEntry>" | |||||
| moduleName = "App" | |||||
| usesParentBreakpointCondition = "Yes" | |||||
| urlString = "file:///Users/mcarman/Projects/Vapor/fueling_v1/Sources/App/Controllers/FuelEntryV2Controller.swift" | |||||
| startingColumnNumber = "9223372036854775807" | |||||
| endingColumnNumber = "9223372036854775807" | |||||
| startingLineNumber = "30" | |||||
| endingLineNumber = "30"> | |||||
| </Location> | |||||
| </Locations> | |||||
| </BreakpointContent> | |||||
| </BreakpointProxy> | |||||
| </Breakpoints> | |||||
| </Bucket> | |||||
| @@ -0,0 +1,14 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||||
| <plist version="1.0"> | |||||
| <dict> | |||||
| <key>SchemeUserState</key> | |||||
| <dict> | |||||
| <key>Fueling.xcscheme_^#shared#^_</key> | |||||
| <dict> | |||||
| <key>orderHint</key> | |||||
| <integer>0</integer> | |||||
| </dict> | |||||
| </dict> | |||||
| </dict> | |||||
| </plist> | |||||
| @@ -10,7 +10,15 @@ public func configure(_ app: Application) async throws { | |||||
| app.routes.defaultMaxBodySize = "128mb" | app.routes.defaultMaxBodySize = "128mb" | ||||
| // let timeout = HTTPClient.Configuration.Timeout(connect: .seconds(300), read: .seconds(300)) | // let timeout = HTTPClient.Configuration.Timeout(connect: .seconds(300), read: .seconds(300)) | ||||
| // app.http.client.configuration.timeout = timeout | // app.http.client.configuration.timeout = timeout | ||||
| app.databases.use(.postgres(hostname: "localhost", username: "mcarman", password: "@ng31F@rm0823262", database: "fueling"), as: .psql) | |||||
| app.databases.use(.postgres(hostname: "127.0.0.1", port: 5433, username: "mcarman", password: "@ng31F@rm0823262", database: "fueling"), as: .psql) | |||||
| // app.databases.use(DatabaseConfigurationFactory.postgres(configuration: .init( | |||||
| // hostname: Environment.get("DATABASE_HOST") ?? "localhost", | |||||
| // port: Environment.get("DATABASE_PORT").flatMap(Int.init(_:)) ?? 5433, | |||||
| // username: Environment.get("DATABASE_USERNAME") ?? "mcarman", | |||||
| // password: Environment.get("DATABASE_PASSWORD") ?? "@ng31F@rm0823262", | |||||
| // database: Environment.get("DATABASE_NAME") ?? "fueling", | |||||
| // tls: .disable) | |||||
| // ), as: .psql) | |||||
| app.http.server.configuration.port = 3002 | app.http.server.configuration.port = 3002 | ||||
| app.migrations.add(CreateFuelEntry()) | app.migrations.add(CreateFuelEntry()) | ||||
| app.migrations.add(AddLatitudeAndLongitudeAndRemoveGpsLocationAndImage()) | app.migrations.add(AddLatitudeAndLongitudeAndRemoveGpsLocationAndImage()) | ||||
| @@ -9,6 +9,10 @@ func routes(_ app: Application) throws { | |||||
| try v2.register(collection: UserController()) | try v2.register(collection: UserController()) | ||||
| let fuelEntryController = FuelEntryController() | let fuelEntryController = FuelEntryController() | ||||
| app.get { | |||||
| req in return "Fueling API v2" | |||||
| } | |||||
| app.get("fuel-entries") { req in | app.get("fuel-entries") { req in | ||||
| try await fuelEntryController.index(req: req) | try await fuelEntryController.index(req: req) | ||||
| } | } | ||||
| @@ -24,6 +28,8 @@ func routes(_ app: Application) throws { | |||||
| // V2 API routes with image upload | // V2 API routes with image upload | ||||
| // let v2Routes: () = app.group("api", "v2") { v2 in | // let v2Routes: () = app.group("api", "v2") { v2 in | ||||
| // let fuelEntryV2Controller = FuelEntryV2Controller() | // let fuelEntryV2Controller = FuelEntryV2Controller() | ||||