2010-12-05 00:20:34 +01:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');
|
2010-04-22 00:15:21 +02:00
|
|
|
|
2010-12-05 00:20:34 +01:00
|
|
|
var http = require('http');
|
|
|
|
var childProcess = require('child_process');
|
2010-04-22 00:15:21 +02:00
|
|
|
|
2010-12-05 23:33:52 +01:00
|
|
|
var s = http.createServer(function(request, response) {
|
2010-04-22 00:15:21 +02:00
|
|
|
response.writeHead(304);
|
|
|
|
response.end();
|
2010-05-28 05:28:12 +02:00
|
|
|
});
|
2010-04-23 00:48:57 +02:00
|
|
|
|
2010-12-05 23:33:52 +01:00
|
|
|
s.listen(common.PORT, function() {
|
|
|
|
childProcess.exec('curl -i http://127.0.0.1:' + common.PORT + '/',
|
|
|
|
function(err, stdout, stderr) {
|
|
|
|
if (err) throw err;
|
|
|
|
s.close();
|
|
|
|
common.error('curled response correctly');
|
|
|
|
common.error(common.inspect(stdout));
|
|
|
|
});
|
2010-04-22 00:15:21 +02:00
|
|
|
});
|
|
|
|
|
2010-12-05 23:33:52 +01:00
|
|
|
console.log('Server running at http://127.0.0.1:' + common.PORT + '/');
|