Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created January 25, 2013 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ynonp/4636526 to your computer and use it in GitHub Desktop.
Save ynonp/4636526 to your computer and use it in GitHub Desktop.
var e = require('express');
var app = e();
app.get('/style.css', function(r, s) {
setTimeout(function() {
s.sendfile('style.css');
}, 5000);
});
app.get('/headfirst', function(r , s ) {
var ok = s.write(
'<html>' +
'<head>' +
'<title>Hello</title>' +
'<link rel="stylesheet" href="style.css" /> ' +
'</head>' +
'<body>');
for ( var i=0; i < 999; i++ ) {
s.write('hello');
}
setTimeout(function() {
s.write('Hello</body></html>');
s.end();
}, 5000);
});
app.listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment