testresources
Version:
Adds fluent interface which, with help from superagent, makes testing HTTP resources simpler.
17 lines (11 loc) • 474 B
JavaScript
var http = require('http');
var winston = require('winston');
var portAllocator = require('./portAllocator');
var startServer = function startServer(app, port) {
// TODO: Eventually should support https
if (!app) throw new Error("The server to start must be provided.")
var server = http.createServer(app.callback());
winston.info("Starting express listening on port %s.", port);
return server.listen(port);
}
module.exports = startServer;