Tag: ibm cloud

我应该如何使用IBM Bluemix的API Manager在OpenWhisk中调用asynchronous操作?

我创build了一个用Node.js写的小型OpenWhisk动作。 此操作会调用后端系统。 执行动作的函数如下(我已经删除了与这个问题无关的那部分代码)。 /** * * main() will be invoked when you Run This Action. * */ function main() { var request = require("request"); var data = { }; var options = { method: "POST", url: "https://whatever.it.is", body: data, json: true }; request.post(options, function(error,response,body) { var data = []; return whisk.done({"msg":data}); }); return whisk.async(); } […]

无法在Bluemix上以FIPS模式运行node.js应用程序

即使在CF CLI上将variablesFIPS_MODE设置为true之后,也无法运行在Bluemix环境中创build的node.js应用程序。

使用Node.js的文件path问题

我正在将一个基于node.js的应用程序部署到IBM的Bluemix,并为其提供的示例之一添加了一些function。 我已经添加了一个额外的JavaScript文件,使PHP调用ajax调用,但PHP文件回来没有find,因为我的path是不正确的。 我试图把文件放在任何地方,只是没有find。 我正在思考(作为一个总节点noobie),我错过了一些神秘的configuration或东西。 在主目录(除其他外),结构是这样的: — views – index.ejs (this is the main displayed code) — public – js – custom.js (my added file) – all the other necessary js files – css – img – php – I added this directory – get-twitter.php – I added this…custom.js makes an ajax call here 在custom.js中,我有这样的: $("#get-twitter").click(function(event) […]

无法从Cloud Foundry CLIlogin到Bluemix Dedicated

我无法从Cloud Foundry CLIlogin到我的Bluemix Dedicated实例。 我有一个“失败”的状态,说 “服务器错误,状态码:404,错误代码:0,消息:” 我正在尝试使用myapp.subdomain.bluemix.net的API端点。 这是我的Bluemix应用程序仪表板中列出的作为到我的应用程序的路线。

在一个Cloudant noSQL数据库中search许多参数

我正在使用Bluemix上的Cloudant数据库将产品存储在Node.js服务器中。 这些产品将按类别search。 要查找只有一个类别的产品,将不会成为问题,因为通过将作为search参数发送的string与保存在数据库中的类别string进行比较来进行search。 产品有两个或更多类别时会出现问题。 在进行string与string的比较时,它不会重合。 产品可以有他们需要的种类。 有任何想法吗?

通过node.js将XML文件加载到cloudant

我在Hackathon,我们必须使用IBM Bluemix技术。 我们都是NodeJ和IBM Bluemix的新手。 我们需要上传这个 XML(也有TTL,RDF和N3格式),以创build一个数据库并上传所有内容。 你有什么build议如何做到这一点?

无法将logging插入到Bluemix中的PostgreSQL中

我尝试在Bluemix平台中使用Node.js来运行postgresql。 但是,有一个问题。 我尝试使用https://www.ng.bluemix.net/docs/#starters/nodejs/index.html#PostgreSQL中描述的代码。 我可以运行我在本地环境中成功编写的应用程序。 但是,它在Bluemix平台中无法正常运行。 以下是描述我所做的代码: var recordVisit = function(req, res) { /* Connect to the DB and auth */ pg.connect(psql, function(err, client, done) { if (err) { return console.error('Error requesting client', err); } console.log(req.ip); client.query('insert into ips(ip, ts) values($1, $2)', [req.ip, new Date()], function(err, result) { if (err) { done(); return console.error('Error inserting ip', […]

Watson用户build模服务返回错误“从VCAP_SERVICES读取时,不能读取未定义的属性'0'

似乎Watson用户build模服务已从我的应用程序中删除。 我在我的应用程序中收到以下错误。 2015-04-09T15:23:38.44-0400 [App/0] ERR /home/vcap/app/lib/config.js:33 2015-04-09T15:23:38.44-0400 [App/0] ERR return vcapServices["user_modeling"][0].credentials.url; 2015-04-09T15:23:38.44-0400 [App/0] ERR ^ 2015-04-09T15:23:38.44-0400 [App/0] ERR TypeError: Cannot read property '0' of undefined 2015-04-09T15:23:38.44-0400 [App/0] ERR at Object.watsonUrl (/home/vcap/app/lib/config.js:33:53) 2015-04-09T15:23:38.44-0400 [App/0] ERR at getPersonality (/home/vcap/app/lib/app.js:203:25) 2015-04-09T15:23:38.44-0400 [App/0] ERR at async.waterfall.personalityUser1 (/home/vcap/app/lib/app.js:278:13) 2015-04-09T15:23:38.44-0400 [App/0] ERR at fn (/home/vcap/app/node_modules/async/lib/async.js:641:34) 2015-04-09T15:23:38.44-0400 [App/0] ERR at Object._onImmediate (/home/vcap/app/node_modules/async/lib/async.js:557:34) […]

发送httppost请求到Bluemix部署的Node.js应用程序时,“不幸的是应用程序已经停止”错误

我正在创build一个Android应用程序,但使用httppost方法向Bluemix部署的Node.js服务器发送参数时,出现“不幸的应用程序已停止”错误。 有谁能帮我解决这个问题吗? 我有查询,无法从Node.js收到门票链接的响应: 我无法将我的请求参数发送到bluemix部署的node.js Jave代码如下: package com.example.rest; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import android.support.v7.app.ActionBarActivity; import android.app.Dialog; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Adapter; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; […]

如何对Bluemix中的节点应用程序执行cors请求

我在bluemix上制作了一个nodeapp,并且绑定到了业务规则服务上,而且我还在mobilefirst上创build了另一个应用程序,我创build了我的应用程序UI。 我想从mobilefirst应用程序发送数据和接收数据,我被告知使用cors请求,但我不知道如何做到这一点。 这里是我的app.js文件: var app = require("express")(), restler = require("restler"), bodyParser = require("body-parser"); app.use(bodyParser.json()); app.use(function(request, response, next) { response.header("Access-Control-Allow-Origin", "*"); response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With,Content-Type, Accept"); next(); }); app.post("/", function(request, response) { var options = { username: "resAdmin", password: "replace" }; var url = "https://brsv2-6855bc66.ng.bluemix.net/DecisionService/rest" + "/vacationsRuleApp/1.0/vacationsRuleProject/json"; restler.postJson(url, request.body, options).on('complete', function(data) { response.send(data); }); }); app.listen(process.env.VCAP_APP_PORT || […]