From 975d2686f49fee6f26e2ecb9192c28baa9a6cd01 Mon Sep 17 00:00:00 2001 From: Alex Farioletti Date: Fri, 2 May 2014 22:07:31 -0700 Subject: [PATCH 1/2] update for express 4 bodyParser doesn't accept multipart/form data in express 4, multipart middle-ware does the job quite nicley --- samples/Node.js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/Node.js/app.js b/samples/Node.js/app.js index 37c1a13d..f4502a06 100644 --- a/samples/Node.js/app.js +++ b/samples/Node.js/app.js @@ -1,4 +1,6 @@ var express = require('express'); +var multipart = require('connect-multiparty'); +var multipartMiddleware = multipart(); var flow = require('./flow-node.js')('tmp/'); var app = express(); @@ -9,7 +11,7 @@ app.use(express.static(__dirname + '/../../src')); app.use(express.bodyParser()); // Handle uploads through Flow.js -app.post('/upload', function(req, res){ +app.post('/upload', multipartMiddleware, function(req, res){ flow.post(req, function(status, filename, original_filename, identifier){ console.log('POST', status, original_filename, identifier); res.send(200, { From e2ebe2c31cc34cd809228d9cd7bf372e6a2d4a6a Mon Sep 17 00:00:00 2001 From: Alex Farioletti Date: Sat, 3 May 2014 13:01:04 -0700 Subject: [PATCH 2/2] Update README.md express bleeding edge issues --- samples/Node.js/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Node.js/README.md b/samples/Node.js/README.md index 86823286..e136c5c1 100644 --- a/samples/Node.js/README.md +++ b/samples/Node.js/README.md @@ -5,7 +5,7 @@ This sample is written for [Node.js 0.6+](http://nodejs.org/) and requires [Expr To install and run: cd samples/Node.js - npm install express@3.* + npm install express node app.js Then browse to [localhost:3000](http://localhost:3000).