Reputation: 678
How to resolve 'SyntaxError: Unexpected token )' ?
I creating a route with nodejs
and im getting this error
/var/pbxapi_nodejs/routes/confbridges.js:26
});
^
SyntaxError: Unexpected token )
at Module._compile (module.js:439:25)
This is my code:
var confbridges = express.Router();
var appInit = require('../app');
var basedir = appInit.basedir;
var logger = appInit.logger;
var config = appInit.config;
var mongodb = appInit.mongodb;
var _ = appInit.underscore;
confbridges.get('/conference/confbridges/:circle/:confUid', function(req, res) {
var confbridges = [];
mongodb.model("Confbridge"), function(err, result){
var confbridges = JSON.parse(JSON.stringify(result));
if(confbridges.length > 0){
res.json(confbridges);
}else{
res.json(confbridges);
}
});
});
module.exports = confbridges;
What is the possible cause of this error?
Upvotes: 0
Views: 3217
Reputation: 5704
Your problem is )
after mongodb.model("Confbridge") <<<
remove it so it looks like
mongodb.model("Confbridge", function(err, result){
Upvotes: 6