Localhost REST service cannot connect

Localhost REST service cannot connect

  

Hi,

I have a local rest service (node.js) running on port 3000 on my developer machine (localhost). I would like to get my Mobile App to connect to this service, but it fails to connect.

There have been many posts around this issue, but non for platform 10 and have reviewed without success (they are also quite old so seem to refer to older environments).,So asking this to understand better/ find out what I'm missing.

Here is more detail of what I've done in Outsystems 10:

I've created REST API's, and set the address (Base URL) to http://localhost:3000

Then I have a POST entry (Rest API Method) with URL Path set to /api/login

I then open up the REST API Method (Doubleclick). Method URL is set to http://localhost:3000/api/login.

I click the TEST tab, and hit TEST button. Says 'Contacting cloud'. Then I  get the following response:

Internal Server Error.Unable to connect to the remote server

No, I gather that the environment outsystems is running this on is on a remote server in the cloud. I thought however that there is some bridge to my local environment. How can I set this up? Do I need to configure some port forwarding, or is there a firewall of sorts to open? Or does OutSystems require me to open up a public IP for dev testing (hopefully not!).


Please advise what I'm missing.The platform looks great so really want to continue playing but without access to my REST service it's a bit boring :-)


Thanks!

Gerhard

Hi Gerhard,

Your OutSystems applications run indeed not on your local machine, but on an application server. That could be on premise or in the cloud. I assume you connect Service Studio to something like gerhardoosthuizen.outsystemscloud.com? Then that's where your OutSystems web apps are running (which also shows when you open them in your browser).

localhost, by definition, is the name for the local computer, i.e. the computer that the application is running on. Every internet-connected computer in the world has a localhost. There is really no way at all for the OutSystems application server to know that you intend it to connect to your development machine, that may not even be reachable from the outside world (e.g. because it sits behind a firewall in a company network). Even if there were a "bridge" to the local environment (via VPN? anyway, there isn't), localhost would still be the server's own localhost.

So yes, if you really need your OutSystems apps (hosted in the cloud) to connect to a dev machine that's inside your office, you need to have a public IP.