简体   繁体   中英

SyntaxError: Unexpected token )

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?

你的问题是)mongodb.model("Confbridge") <<<删除它之后看起来像

mongodb.model("Confbridge", function(err, result){

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM