Skip to content

Instantly share code, notes, and snippets.

@mmalecki
Created August 20, 2011 10:29
Show Gist options
  • Save mmalecki/1158938 to your computer and use it in GitHub Desktop.
Save mmalecki/1158938 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'application/pdf'});
fs.readFile('pdf.pdf', function (err, data) {
if (err) {
res.end('oh shit');
return;
}
res.end(data);
});
}).listen(1337, "127.0.0.1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment