Skip to content

app.get() method unknown?  #3

@bayvictor

Description

@bayvictor

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 >

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions