Created
January 30, 2012 19:13
-
-
Save thomaschaaf/1706067 to your computer and use it in GitHub Desktop.
This file contains 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
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