Skip to content

Commit

Permalink
adding data chunk handling, session with redis store
Browse files Browse the repository at this point in the history
  • Loading branch information
dzincolorado committed May 11, 2012
1 parent 3cd696d commit 1db94a5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
25 changes: 25 additions & 0 deletions DataChunkHandler.js
@@ -0,0 +1,25 @@
/**
* @author dziegler
*/
//var exec = require('child_process').exec;
var querystring = require('querystring');

function HandleDataChunks(request, response)
{
request.setEncoding('utf8');

var postData = "";
request.addListener("data", function(postDataChunk) {
postData += postDataChunk;
console.log("Received POST data chunk" + postDataChunk + "'.");

});

request.addListener("end", function(postDataChunk){
//route the request
//route(handle, pathname, response, postData)
return querystring.parse(postData).text;
});
}

exports.HandleDataChunks = HandleDataChunks;
2 changes: 1 addition & 1 deletion views/start.jade
Expand Up @@ -6,5 +6,5 @@ block mainContent
form(action='/upload', method='post')
textarea(name="text", rows="20", cols="60")
br
input(type="submit, value="Submit text", class="input-xlarge")
input(type="submit", value="Submit text", class="input-xlarge")

4 changes: 4 additions & 0 deletions views/upload.jade
@@ -0,0 +1,4 @@
extends layout

block mainContent
p= content

0 comments on commit 1db94a5

Please sign in to comment.