0
我分不清什么是错这个发生器功能:类型错误:你可能只产生一个功能,承诺,发电机......产生app.listen时()
var dbUrl = 'mongodb://localhost:27017/voyanta';
var db;
var server;
co(function*() {
// Use connect method to connect to the Server
db = yield MongoClient.connect(dbUrl);
server = yield app.listen(3000);
console.log('Connected to database. Listening on port 3000.');
}).catch(function(err) {
console.log(err.stack);
});
它看起来完全没有给我,但行“server = yield app.listen(3000);”创建错误:“类型错误:您可能只产生函数,承诺,生成器,数组或对象,但传递了以下对象:”[object Object]“