Skip to content

Instantly share code, notes, and snippets.

@sghiassy
Created September 25, 2015 17:21
Show Gist options
  • Select an option

  • Save sghiassy/c2d11f6ef1e52a431abf to your computer and use it in GitHub Desktop.

Select an option

Save sghiassy/c2d11f6ef1e52a431abf to your computer and use it in GitHub Desktop.
function runServer(options, readyCallback) {
var app = connect()
.use(loadRawBody)
.use(openStackFrameInEditor)
.use(getDevToolsLauncher(options))
.use(statusPageMiddleware)
// Temporarily disable flow check until it's more stable
//.use(getFlowTypeCheckMiddleware(options))
.use(getAppMiddleware(options));
options.projectRoots.forEach(function(root) {
app.use(connect.static(root));
});
app.use(connect.logger())
.use(connect.compress())
.use(connect.errorHandler());
return http.createServer(app).listen(options.port, '::', readyCallback);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment