0

I followed API Connect getting started guide to create a local loopback API app and tested successfully. Then I am trying to follow Publish Your API to Bluemix. The publishing is successful. The app is running. But clicking the app yields Chrome error:

This site can’t provide a secure connection
ddd.abbr-dev2.apic.mybluemix.net sent an invalid response.

I suspect the problem is incorrect port. According to CloudFoundry Nodejs tips, the port should use process.env.PORT, but loopback defaults to 3000. Following this clue, I tried adding config.local.js:

module.exports = {
  port: process.env.PORT
};

But the service end point is still inaccessible. Please Help. Thanks

The Onin
  • 5,068
  • 2
  • 38
  • 55
abbr
  • 5,361
  • 6
  • 30
  • 44
  • Can you show your code on how are accessing the port in the main app file or starting the server? Thanks! – giri-sh May 16 '16 at 07:55
  • @GirishSortur, my code is in https://github.com/f-w/transcript-api. The main file server/server.js is generated by `apic loopback` and unmodified. I haven't push config.local.js to GitHub. – abbr May 16 '16 at 17:59

1 Answers1

2

This is actually by design. Since your API's implementation is on the public internet, it is secured via Mutual TLS. The only way to access it is via the API Connect gateway, thus ensuring the API is managed.

If you want to make it accessible publicly, open the app in the Bluemix console and add an additional route to the app, using the mybluemix.net domain.

Matt Hamann
  • 1,488
  • 12
  • 24
  • Using mybluemix.net domain works. Do you mean if I remove .git folder before publishing, then I can also use apic.mybluemix.net domain? – abbr May 17 '16 at 04:26
  • No, that folder has no effect. At present, if you publish the app via the API Connect toolkit, it will automatically have the TLS profile attached. – Matt Hamann May 17 '16 at 04:30
  • I saw you are Bluemix engineer. I suggest updating the docs [Publish Your API to Bluemix](https://developer.ibm.com/apiconnect/getting-started/publish-your-api-to-bluemix/). – abbr May 17 '16 at 04:35