I'm running a node.js Express server on localhost. I'm making some API calls to the server using Alamofire from an iPhone app I'm developing in Swift:
Alamofire.request(url, method: .post, parameters: parameters, encoding: JSONEncoding.default, headers: nil).responseJSON { (response:DataResponse) in ... }
url is "http://localhost:5000/api/test"
Everything works fine when I run the app in the simulator; it can access localhost just fine. But when I run on a device, I get "Could not connect to the server."
Do I have to deploy the server code somewhere like Heroku in order to test on a local device connected to the same network?
192.168.x.x- WilomGfx