Skip to content

Instantly share code, notes, and snippets.

@pagameba
Created January 21, 2011 20:51
Show Gist options
  • Save pagameba/790394 to your computer and use it in GitHub Desktop.
Save pagameba/790394 to your computer and use it in GitHub Desktop.
var Seq = require('node-seq');
var configFile = require('path').join(__dirname, 'config.json');
Seq()
.seq(checkPath),
.seq(parseConfig),
.seq(connectToDb),
.seq(startServer),
.catch(function(err) {
console.error(err.stack ? err.stack : err);
});
function checkPath() {
path.exists(configFile, function(exists) {
if (!exists) {
throw new Error('Config file ' + configFile + ' does not exist. Use `cp config.json.sample '+configFile+'`.');
} else {
this(null);
}
});
}
function parseConfig() {
}
function connectToDb() {
}
function startServer() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment