Tag: ibm cloud

如何使用IBM IoTF nodeJS库将移动应用程序(Ionic 2)连接到IBM IoT

我在一个基于Cordova的物联网项目。 我正在使用Ionic 2框架(Typescript)。 正是问题所在:我在将移动应用程序连接到IBM IoT平台时遇到问题。 ::在前端:: 我有Mobilerified版本的移动应用程序代码( app.bundle.js )。 ::在后端:: 我有根据Loopback应用程序的通用结构的server.js文件。 这是我目前遇到的问题: IBM IoTf是一个nodeJS库。 但它有一个Browserified捆绑版本( iotf-client.bundle.js )。 该应用程序还有一个Browserified捆绑版本( app.bundle.js )。 如果我在应用程序构build过程中同时使用了捆绑版本,则只有其中一个function – 应用程序或IBM IoT可以运行; 但不是两者。 由于IBMIoTF对窗口全局对象不可用。 应用程序后端( server.js )未连接到Bluemix。 如果尝试使用ibmbluemix nodeJS程序包(现在不推荐使用)将其初始化到Bluemix平台,那么移动前端将无法连接到Bluemix平台。 所以,我可以推断,我无法从移动前端和后端连接并初始化Bluemix SDK。 在这种情况下,我应该如何从移动应用程序到移动后端连接到IBM物联网平台? 它使用简单的GET / POST HTTP请求吗? 如果是的话,我也尝试从Ionic(绑定在app.bundled.js)发送一个HTTP POST请求到移动后端(server.js)。 但没有任何事情发生。 PS:我已经安装了cordova-whitelist插件 这是项目的URL: https://github.com/somnathbm/pearl

无法加载资源:服务器在angular.js中的状态为404(未find)

我创build了一个war文件,并试图将其部署在bluemix上。 App.js var express = require("express"); var app = express(); var path = require("path"); app.use("/", express.static(__dirname)); app.get('/', function(req, res) { res.sendFile(path.join(__dirname + '/ingestion-scala-apidocs/index.html')); }); app.set('port', process.env.PORT); console.log(port); manifest.yml applications: – name: connectors path: connectors.war memory: 900M instances: 1 host: connectors domain: mybluemix.net 推到bluemix并点击主机名后,我得到以下错误: Failed to load resource: the server responded with a status of 403 […]

如何将用户名和密码发送到在Bluemix上运行的node.js服务器?

我正在创build一个在Bluemix中部署的Android应用程序。 我需要从我的Android应用程序发送用户名和密码到在Bluemix上运行的Node.js。 任何人都可以build议我如何做到这一点?

如何使用node.js httpRequest连接到dashdb

我们如何使用node.js的HTTP / Request模块连接到Dash DB并执行R-script代码。 我可以使用Node-RED来完成,但是也可以通过编程来完成。 现在我得到这个错误: 0530 [App/0] ERR Potentially unhandled rejection [2] Error: EACCES, mkdir '/home/nol' 0530 [App/0] OUT STATUS: 500 0530 [App/0] OUT HEADERS: {""content-type":"text/html; charset=UTF-8","set-cookie":Path=/; Secure; HttpOnly"],"connection":"Close", ""} 0530 [App/0] OUT BODY: 0530 [App/0] OUT An internal error has occurred. The application may still be initializing or the URL used is invalid. […]

在ibm云上启动应用程序时找不到模块“ibmbluemix”

我最近在IBM blumix上启动了我的第一个nodeJs应用程序,请参阅这些教程http://ibm-bluemix.coderpower.com/#/warmup/55e07bf49924f792327901cd/code 。 我按照说明,但是当我开始我的应用程序,我有错误无法find模块'ibmbluemix' 我有与本教程相同的代码,我几乎感觉到ibm bluemix模块没有安装在云ibm bluemix上。 这里是代码package.json { "name": "NodejsStarterApp", "version": "0.0.1", "description": "A sample nodejs app for Bluemix", "scripts": { "start": "node app.js" }, "dependencies": { "express": "4.12.x", "cfenv": "1.0.x" }, "repository": {}, "engines": { "node": "0.12.x" } } app.js var express = require('express'); var ibmbluemix = require('ibmbluemix'); var config = { applicationId:"FirstAppli", […]

Bluemix中的Android上的MobileFirst令牌错误

我正在尝试Android上的Bluelist演示 ,我收到下面的错误… 看起来移动服务正在投掷401 。 11-03 19:42:52.469 31488-31527/com.ibm.bluelist E/com.ibm.mobile.services.core.http.IBMMutableHttpRequest﹕ Request to 'https://winmobile.mybluemix.net/data/helo' failed. IBMBLUEMIX-0300E: Request by com.ibm.mobile.services.data.IBMData was rejected by MAS. Status=401, Response={"error":"You are not authorized.","status":"failure"} . 11-03 19:42:52.479 31488-31508/com.ibm.bluelist E/getToken(34252)﹕ Server rejected request for with status code 401 com.ibm.mobile.services.data.internal.HttpFailure: Http Response Code: 401 at com.ibm.mobile.services.data.internal.Connection.getToken(Connection.java:199) at com.ibm.mobile.services.data.internal.Connection.access$400(Connection.java:43) at com.ibm.mobile.services.data.internal.Connection$Receiver.run(Connection.java:412) 11-03 19:42:52.479 31488-31508/com.ibm.bluelist E/Connection:Receiver(34252)﹕ Http Response […]

部署parse-on-bluemix node.js应用程序进行bluemix失败

我在Bluemix中部署node.js,基本上从parse.com迁移到Bluemix。 以下错误是什么意思? 我该如何解决? 我正在使用CF命令行工具。 下面附上的日志。 ////////////////////////////////////////////////// ////////////////////////////////////////////////// ////////////////////////////////////////////////// //////// —–> Checking and configuring service extensions after installing dependencies —–> Installing App Management —–> Caching build Clearing previous node cache Saving 2 cacheDirectories (default): – node_modules – bower_components (nothing to cache) —–> Build succeeded! ├── cf-deployment-tracker-client@0.0.7 ├── express@4.13.4 └── parse-server@2.1.2 —–> Uploading droplet (21M) 0 of […]

推送后未注册的设备被发送

这听起来很奇怪,但我看不到任何其他的解释。 我已经在Bluemix上设置了IBM推送通知,这是我之前完成的。 出于某种原因,我build立了这个新的应用程序。 任何时候我发送一个推送通知,它不会通过,我尝试再次这样做,它告诉我没有设备。 这只发生在我身上,也许是它的服务问题? 有些事情我试过/发现: 我的设备正在注册并通过控制台从服务接收成功的消息。 我只有1个设备,但监控现在告诉我有7个设备已经注册通知。 当使用Web控制台发送推送通知时,它表示第一次成功(但没有任何通过),再次单击说Internal Server error: No devices found 。 使用swagger文档,我input我的appID和search设备,没有出现。 我运行的应用程序,一个显示,我把应用程序在后台,一个仍然显示。 我通过大举发出通知,说成功了,检查注册的设备,返回空数组。 我的iOS应用程序中的代码仅限于为IMFPush / IMFCore cocoapods提供的样本,用于注册。 我没有任何退订代码。 我没有运行任何我的node.js代码,或只使用swagger / web控制台工具的iOS代码validation了这一点。 我正在使用之前用于其他应用的沙箱提供configuration文件。 我已经删除了IMF推送服务并重新创build。 任何帮助/见解将不胜感激。

Bluemix> IBM API Connect> IBM开发人员工具包:ECONNREFUSED错误

了解如何将演示项目部署到Bluemix上的IBM API Connect( 启动 ),并在运行apic edit之后获取以下错误以启动IBM Developer Toolkit本地站点: 错误的屏幕截图 任何build议将不胜感激。

IBM推送:不能在ibmpush.js中使用sendNotificationByDeviceIds

我有一个应用程序,并使用函数sendNotificationByDeviceIds如下: PushNotificationToConsumer: function(req, res) { queryCustomer.find({jpay_no : jpay_no}).done(function(customerReturn){ if(customerReturn.length > 0){ var device_id = customerReturn[0].attributes.device_id.toString(); req.ibmpush.sendNotificationByDeviceIds(message, [device_id], null).then(function(response){ res.json({success : true, message : 'Send notification to patient with device_id:' +device_id+ ' successful ' }); },function(err){ res.json(err); }); }else{ } }, function(err){ res.json(err); }) } 错误消息: 在app.js上:我声明了ibmpush = require('ibmpush') 请帮助给我你的想法。 谢谢