Skip to content

Instantly share code, notes, and snippets.

@Marak
Created January 5, 2010 20:30
Show Gist options
  • Save Marak/269685 to your computer and use it in GitHub Desktop.
Save Marak/269685 to your computer and use it in GitHub Desktop.
http.createServer(function (req, resp) {
sys.puts('http request');
multipart.parse(req).addCallback(function(httpParams) {
sys.puts('multipart.parse');
processRequest( req , resp , httpParams );
}).addErrback(function(){
sys.puts('multipart request error');
resp.sendHeader(200,{'Content-Type':'text/html'});
resp.sendBody('500 error in response');
resp.finish();
});
}).listen(80);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment