Skip to content

Instantly share code, notes, and snippets.

@seanmonstar
Created July 17, 2013 20:48
Show Gist options
  • Save seanmonstar/6024350 to your computer and use it in GitHub Desktop.
Save seanmonstar/6024350 to your computer and use it in GitHub Desktop.
var http = require('http'),
fs = require('fs'),
path = require('path');
http.createServer(function(req, res) {
console.log('======================');
console.log(req.url);
console.log(req.headers);
var filename = '' + Date.now();
var stream = fs.createWriteStream(path.join(__dirname, filename));
req.pipe(stream);
res.writeHead(400);
res.end("400");
}).listen(1337, '127.0.0.1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment