Skip to content

Instantly share code, notes, and snippets.

@dunkfordyce
Created July 12, 2010 07:49
Show Gist options
  • Save dunkfordyce/472227 to your computer and use it in GitHub Desktop.
Save dunkfordyce/472227 to your computer and use it in GitHub Desktop.
module.exports = connect.createServer(
connect.staticProvider(__dirname),
connect.router(function(app) {
app.post('/posttest', function(req, resp, params) {
sys.puts('post request');
req.setEncoding('utf8');
var body = '';
req.addListener('data', function(data) {
sys.puts('data'+ data);
body += data;
});
req.addListener('end', function() {
sys.puts('done'+ body);
resp.writeHead(200, { 'Content-Type': 'text/plain' });
resp.end( "done" );
});
});
});
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment