Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

give the server 100ms to start up

  • Loading branch information...
commit 1e6273ea14a75acffec6e1f17fa42eb1a32b48a0 1 parent 6eeef0a
James Halliday substack authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 test/web.js
7 test/web.js
View
@@ -7,12 +7,11 @@ exports.webserver = function (assert) {
var server = connect.createServer();
server.use(connect.cookieDecoder());
- //*
server.use(connect.session({
store : new Cart({ dbFile : '/tmp/cart-' + port + '.db' }),
secret : 'meowmers',
}));
- //*/
+
server.use(connect.router(function (app) {
app.get('/', function (req, res) {
res.writeHead(200, { 'Content-Type' : 'text/html' });
@@ -22,7 +21,7 @@ exports.webserver = function (assert) {
}));
server.listen(port, 'localhost');
- {
+ setTimeout(function () {
var client = http.createClient(port);
var req = client.request('GET', '/', { host : 'localhost' });
req.end();
@@ -32,5 +31,5 @@ exports.webserver = function (assert) {
});
server.close();
});
- }
+ }, 100);
};
Please sign in to comment.
Something went wrong with that request. Please try again.