You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when run "node start.js" (start.js copy-paste from here) having below error:
/sda1/src/social_game/hi5/api-client-js-master/start.js:15
app.get('/', function(req, res) {
^
TypeError: Object function app(req, res, next){ app.handle(req, res, next); } has no method 'get'
at Object. (/sda1/src/social_game/hi5/api-client-js-master/start.js:15:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
<start.js code starts >
// Low level access
var TaggedApi = require('tagged-api');
var api = new TaggedApi('http://www.tagged.com/api.php', {
session_id: 'abc123' // Session cookie ID from request
});
// Or use middleware to automatically create an api instance for each request
var connect = require('connect');
var app = connect();
var TaggedApi = require('tagged-api');
app.use(TaggedApi.middleware());
//var server = app.createServer("http://www.tagged.com/api.php")
app.get('/', function(req, res) {
//server.get('/', function(req, res) {
// Make API calls on behalf of the user that is authenticated with this request
req.api.execute('user.whoami').then(function(result) {
res.send(result);
}).done();
});
api.execute('im.send', {
to: 12345,
message: 'Join the party!'
})
also cause
TypeError: Cannot call method 'post' of undefined
at TaggedApi._postToApi (/sda1/src/social_game/hi5/node_modules/tagged-api/lib/index.js:90:20)
at Timer.listOnTimeout as ontimeout
eror,
Do I miss anything? I to a "npm install " "sudo npm install -g " to resolve auto-dependency already.
The Tagged API client isn't quite production ready, but we're actively working on it. Keep an eye on the README.md -- we'll update it with clearer instructions soon.
Thank you for the prompt response, I look forward to playing with your README.md -- step by step working sample -- very soon, where app.get() & TaggedApi._postToApi () won't have any more issue. :)
Cheers,
Victor.
when run "node start.js" (start.js copy-paste from here) having below error:
/sda1/src/social_game/hi5/api-client-js-master/start.js:15
app.get('/', function(req, res) {
^
TypeError: Object function app(req, res, next){ app.handle(req, res, next); } has no method 'get'
at Object. (/sda1/src/social_game/hi5/api-client-js-master/start.js:15:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
<start.js code starts >
// Low level access
var TaggedApi = require('tagged-api');
var api = new TaggedApi('http://www.tagged.com/api.php', {
session_id: 'abc123' // Session cookie ID from request
});
// Or use middleware to automatically create an api instance for each request
var connect = require('connect');
var app = connect();
var TaggedApi = require('tagged-api');
app.use(TaggedApi.middleware());
//var server = app.createServer("http://www.tagged.com/api.php")
app.get('/', function(req, res) {
//server.get('/', function(req, res) {
// Make API calls on behalf of the user that is authenticated with this request
req.api.execute('user.whoami').then(function(result) {
res.send(result);
}).done();
});
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
<start.js code ends >
The text was updated successfully, but these errors were encountered: