Created
July 12, 2010 07:49
-
-
Save dunkfordyce/472227 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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