want to learn nodeJS, learn online tutorials, use express+mongoDB to do a simple blog system, occasionally do not connect to the network to start the project, the result is wrong, can not start normally, when the network connection is normal, everything is normal, when disconnected from the network, offline status, start the project MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: getaddrinfo ENOENT localhost:27017]
error message:
var settings = require("../settings"),
Db = require("mongodb").Db,
Connection = require("mongodb").Connection,
Server = require("mongodb").Server;
module.exports = new Db(settings.db, new Server(settings.host, 27017, {}));
I hope the great god will give me some advice