Skip to content

Instantly share code, notes, and snippets.

@Marak
Created February 21, 2010 10:07
Show Gist options
  • Save Marak/310238 to your computer and use it in GitHub Desktop.
Save Marak/310238 to your computer and use it in GitHub Desktop.
var sys = require('sys'),http = require('http'),multipart = require( 'multipart' ),fs=require('fs'),mime=require('./mime'),api=require('./api'),querystring=require('querystring'),url=require('url'),hookIO=require('./hookIO');
http.createServer(function (req, resp) {
req.body = '';
req.addListener('data',function(chunk){
req.body += chunk
})
req.addListener('end', function(){
var httpParams = {};
process.mixin(true, httpParams, url.parse(req.url));
process.mixin(true, httpParams, querystring.parse(req.body));
sys.puts(JSON.stringify(httpParams));
hookIO.hookIO.acceptRequest( req , resp , httpParams );
})
}).listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment