Skip to content

Instantly share code, notes, and snippets.

@thomaschaaf
Created January 30, 2012 19:13
Show Gist options
  • Save thomaschaaf/1706067 to your computer and use it in GitHub Desktop.
Save thomaschaaf/1706067 to your computer and use it in GitHub Desktop.
var express = require('express')
, routes = require('./routes')
, formidable = require("formidable");
var config = require("./config");
var app = module.exports = express.createServer();
// Configuration
app.configure(function(){
app.use(function(req, res, next){
if (req.url == '/api/soap/eyefilm/v1/upload') {
var form = new formidable.IncomingForm();
console.log("Upload startet");
form.on('progress', function(bytesReceived, bytesExpected) {
console.log("called");
var progress = {
type: 'progress',
bytesReceived: bytesReceived,
bytesExpected: bytesExpected
};
console.log(progress);
});
}
next();
});
app.set('views', __dirname + '/views');
app.register("html", require('ejs'));
app.set('view engine', 'html');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment