Open dur41d opened 10 years ago
Hi @dur41d , looks like that mongodb-rest2 has been installed with express 3. That could be caused by "express": ">= 2.4.7",
in package.json
.
Try installing mongodb-rest2 locally and override installed express version via npm install express@2.4.7
in the same folder.
MacBook-Pro:dev duraid$ cat config.json { "dbconnection": { "port": 27017, "host": "localhost" }, "port": 3000, "mode": "development", "autoStart": true } MacBook-Pro:dev duraid$ mongodb-rest2 Warning: express.createServer() is deprecated, express applications no longer inherit from http.Server, please use:
var express = require("express"); var app = express();
/usr/local/lib/node_modules/mongodb-rest2/server.js:87 og("Express server | mongodb rest interface listening on port "+app.address(). ^ TypeError: Object function app(req, res, next){ app.handle(req, res, next); } has no method 'address' at Function.app.start (/usr/local/lib/node_modules/mongodb-rest2/server.js:87:76) at Object.exports.create (/usr/local/lib/node_modules/mongodb-rest2/server.js:93:7) at Object. (/usr/local/lib/node_modules/mongodb-rest2/app.js:18:8)
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 Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/mongodb-rest2/bin/mongodb-rest2:2:1)