0

How do I host a publicly accessible web app on IBM Bluemix?

The app is built with Ionic framework and an IBM Cloudant DB. The app and Cloudant communicate through managed APIs. I could register the app on mobile foundation and run it locally on Xcode simulator, as well as Chrome locally. But I could not find a way on Bluemix to host app as a pure web app living in the browser.

I expect that my app to be available on a link like someapp.mybluemix.net. I do not prefer launching this prototype version of my app through the App Store in the near future.

I found it very easy with AWS - I only needed to upload the content in my build folder to S3 - and the index page is my public web app. But I prefer to use purely Bluemix services.

PS: I managed to upload a web version of the app alongside iOS version to mobile foundation. The steps were:

  1. add browser to the Cordova platform locally
  2. register the app and push the app again to the mobile foundation server

But I still could not find the link to which the app is available publicly.

screenshot from IBM mobile foundation console

Error from Bluemix Deploy stage (partial):

 !     This app may not specify any way to start a node process
       http://docs.cloudfoundry.org/buildpacks/node
Exit status 0
Uploading droplet, build artifacts cache...
Staging complete
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (52.7M)
Uploaded droplet (75.9M)
Uploading complete
Stopping instance f714f8a4-ff4d-4a59-9a3e-5d418926
Destroying container
Successfully destroyed container

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful

TIP: use 'cf logs testApp --recent' for more information

Finished: FAILED

I built the app again on continuous delivery and it crashed. This time I got the additional logs:

2018-04-04T10:08:04.49+0800 [APP/PROC/WEB/0] ERR npm ERR! Linux 4.4.0-109-generic
   2018-04-04T10:08:04.50+0800 [APP/PROC/WEB/0] ERR npm ERR! argv "/home/vcap/app/vendor/node/bin/node" "/home/vcap/app/vendor/node/bin/npm" "start"
   2018-04-04T10:08:04.50+0800 [APP/PROC/WEB/0] ERR npm ERR! node v6.13.0
   2018-04-04T10:08:04.50+0800 [APP/PROC/WEB/0] ERR npm ERR! npm  v3.10.10
   2018-04-04T10:08:04.50+0800 [APP/PROC/WEB/0] ERR npm ERR! missing script: start
   2018-04-04T10:08:04.50+0800 [APP/PROC/WEB/0] ERR npm ERR! 
   2018-04-04T10:08:04.50+0800 [APP/PROC/WEB/0] ERR npm ERR! If you need help, you may report this error at:
   2018-04-04T10:08:04.50+0800 [APP/PROC/WEB/0] ERR npm ERR!     <https://github.com/npm/npm/issues>
   2018-04-04T10:08:04.51+0800 [APP/PROC/WEB/0] ERR npm ERR! Please include the following file with any support request:
   2018-04-04T10:08:04.51+0800 [APP/PROC/WEB/0] ERR npm ERR!     /home/vcap/app/npm-debug.log
Victor
  • 13
  • 4

1 Answers1

1

You can use the IBM cloud Cloud Foundary Apps boilerplates to create webapps for nodejs,java,python,ruby,go etc. You can then use the Continuous Delivery Service to create code pipeline and for source control.

Documentation can be found here. This link talks about hosting a nodejs webapp. Hope this helps.

Vasanth Raghavan
  • 162
  • 2
  • 12
  • To replace the boiler plate code, I pasted the the app directory from my ionic app into the boiler plate code directory. The ionic build files go under the www/ folder which I renamed to public/ in order to follow the boilerplate code. But then the build failed. The log was long but it appeared that the deployment step failed to recognise how to start the app. The build stage was completed successfully on continuous delivery pipeline – Victor Mar 20 '18 at 11:43
  • can you give us this error message ? you might have to raise a ticket with the ibm cloud team to pursue this further. – Vasanth Raghavan Mar 20 '18 at 11:47
  • can you show the output of the following command as indicated in the error log above : 'cf logs testApp --recent' – Vasanth Raghavan Mar 22 '18 at 11:45
  • It read "Retrieving logs for app testApp in org organisationA / space us_dev as some@email.com.." and a blank line. Apologies for the delay - I tried working with the IBM support team with a ticket but they responded only sparsely and provided irrelevant online tutorials as "solution". – Victor Apr 04 '18 at 01:54
  • I built the app again on continuous delivery and it crashed. This time I got the additional logs: – Victor Apr 04 '18 at 02:11
  • I eventually resolved it by adding back the dependencies into the package.json file for cfenv and express. – Victor Apr 04 '18 at 05:17