Skip to content

Commit 35b9a87

Browse files
committed
Format lines
1 parent 847d556 commit 35b9a87

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

server/server.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var express = require('express'),
2929
bodyParser = require('body-parser');
3030

3131
app.use(cookieParser());
32-
app.use(bodyParser.urlencoded({extended : true}));
32+
app.use(bodyParser.urlencoded({extended: true}));
3333
app.use(session({
3434
cookie: {maxAge: 720000000},
3535
resave: false,
@@ -223,14 +223,14 @@ app.get('/download_file', function (req, res) {
223223
function (error, response, body) {
224224

225225
//response.on('end', function (chunk) {
226-
fs.writeFile('../client/downloads/' + fileName, body, function (err) {
227-
var successObj = {downloadUrl: 'downloads/' + req.query.fileName};
228-
if (!err) {
229-
res.send(JSON.stringify(successObj));
230-
} else {
231-
res.send(JSON.stringify({error: 'Error in returning file'}));
232-
}
233-
});
226+
fs.writeFile('../client/downloads/' + fileName, body, function (err) {
227+
var successObj = {downloadUrl: '/downloads/' + req.query.fileName};
228+
if (!err) {
229+
res.send(JSON.stringify(successObj));
230+
} else {
231+
res.send(JSON.stringify({error: 'Error in returning file'}));
232+
}
233+
});
234234
//});
235235
});
236236

0 commit comments

Comments
 (0)