Chapter 12. Simulator not fetching data from localhost

So I try to fetch acronyms from database and I keep getting an error. What I see in iOS app project terminal is this:

2021-02-12 01:27:36.007178+0200 TILiOS[25607:2147533] [connection] nw_socket_handle_socket_event [C3.1:2] Socket SO_ERROR [61: Connection refused]

And Vapor terminal shows me this:

[ DEBUG ] No available connections on this event loop, creating a new one [database-id: psql, request-id: CA403EF6-B422-4494-80B9-40EC620508F8] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:202)

[ DEBUG ] SELECT “acronyms”.“id” AS “acronyms_id”, “acronyms”.“short” AS “acronyms_short”, “acronyms”.“long” AS “acronyms_long”, “acronyms”.“userID” AS “acronyms_userID” FROM “acronyms” [] [database-id: psql, request-id: CA403EF6-B422-4494-80B9-40EC620508F8] (PostgresNIO/PostgresDatabase+Query.swift:124)

just to clarify, I have tested and am able to fetch data with both Rested and in browser, yet no luck with the app in simulator.

Okay, my Acronym model was wrong, it seems. I guess I have solved this one.

1 Like

Thank you for providing us with an update! Glad you were able to solve the problem.