Last active
August 29, 2015 14:10
-
-
Save captainkovalsky/8ab2b7dc94fc02818157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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