0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-25 08:19:38 +01:00
nodejs/test/parallel/test-http-304.js

23 lines
705 B
JavaScript
Raw Normal View History

2010-12-05 00:20:34 +01:00
var common = require('../common');
var assert = require('assert');
2010-12-05 00:20:34 +01:00
var http = require('http');
var childProcess = require('child_process');
var s = http.createServer(function(request, response) {
response.writeHead(304);
response.end();
2010-05-28 05:28:12 +02:00
});
2010-04-23 00:48:57 +02: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));
});
});
console.log('Server running at http://127.0.0.1:' + common.PORT + '/');