Skip to content

Commit

Permalink
Remove obsolete "upload" route and controller: #25
Browse files Browse the repository at this point in the history
I added a new controller and route for uploads in commit b34aeba.
However, as of commit cc7fdb2, we're processing the file on the browser
side, so there's no longer any need for the "upload" route.  The file is
never uploaded.  This commit just removes that no-longer-needed code.
  • Loading branch information
cecilia-donnelly committed Aug 6, 2015
1 parent 21e3221 commit 508e9e0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
20 changes: 0 additions & 20 deletions app/controllers/core.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,8 @@
* Module dependencies.
*/
exports.index = function(req, res) {
if (req.method == "POST"){
var body = '';
req.on('data', function (data) {
body += data;
if (body.length > 1e6) {
req.connection.destroy();
}
});
req.on('end', function () {
// naming this "file_data" because I assume that we will
// only be POST-ing imported files. This may change in the
// future.
// split out the contents from the headers and footers
var csv_body = body.split("\r\n");
var csv_contents = csv_body[4];
res.send(csv_contents);
});
}
else{
res.render('index', {
user: req.user || null,
request: req
});
}
};
1 change: 0 additions & 1 deletion app/routes/core.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ module.exports = function(app) {
// Root routing
var core = require('../../app/controllers/core.server.controller');
app.route('/').get(core.index);
app.route('/upload').post(core.index);
};

0 comments on commit 508e9e0

Please sign in to comment.