在 IBM Bluemix 上托管 Ionic Web App

Hosting Ionic Web App on IBM Bluemix

如何在 IBM Bluemix 上托管 public 仅可访问的 Web 应用程序?

该应用程序是使用 Ionic 框架和 IBM Cloudant 数据库构建的。该应用程序和 Cloudant 通过托管 API 进行通信。我可以在移动基础上注册该应用程序,并在本地 Xcode 模拟器上 运行 注册它,也可以在本地 Chrome 注册它。但是我无法在 Bluemix 上找到将应用程序托管为浏览器中的纯 Web 应用程序的方法。

我希望我的应用程序可以在 link(例如 someapp.mybluemix.net)上使用。我不希望在不久的将来通过 App Store 发布我的应用程序的这个原型版本。

我发现使用 AWS 非常容易 - 我只需要将构建文件夹中的内容上传到 S3 - 索引页面就是我的 public 网络应用程序。但我更喜欢使用纯粹的 Bluemix 服务。

PS:我设法将应用程序的网络版本与 iOS 版本一起上传到移动基础。步骤是:

  1. 在本地添加浏览器到Cordova平台
  2. 注册应用并再次推送到移动基础服务器

但我仍然找不到 link 可以使用该应用程序 publicly。

screenshot from IBM mobile foundation console

Bluemix 部署阶段的错误(部分):

 !     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

我在持续交付上再次构建应用程序,但它崩溃了。这次我得到了额外的日志:

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

您可以使用 IBM 云 Cloud Foundary Apps boilerplates to create webapps for nodejs,java,python,ruby,go etc. You can then use the Continuous Delivery Service 创建代码管道和进行源代码控制。

可以找到文档 here。 link 讨论托管 nodejs webapp。希望这有帮助。