Skip to content

Instantly share code, notes, and snippets.

@captainkovalsky
Last active August 29, 2015 14:10
Show Gist options
  • Save captainkovalsky/8ab2b7dc94fc02818157 to your computer and use it in GitHub Desktop.
Save captainkovalsky/8ab2b7dc94fc02818157 to your computer and use it in GitHub Desktop.
start: function (callback) {
process.env.APPLICATION_ENV = 'development';
var instance = app.instance = fork('app.js', {
execArgv: ['--debug=9999'],
silent: true
});
app._dataListener = function (data) {
// assume that server is started when it prints the following to stdout:
if (data.toString().indexOf('Application started on port') !== -1) {
callback();
}
};
instance.stdout.on('data', app._dataListener);
instance.stdout.pipe(process.stdout);
instance.stderr.pipe(process.stderr);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment