Skip to content

Commit 7b50dd8

Browse files
committed
Send okay once renamed
1 parent 5f5ba56 commit 7b50dd8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ app.use(morgan('combined', { stream: log.stream }));
2929
app.use(express.static('public'));
3030

3131
app.post('/file', upload.single('file'), (req, res) => {
32-
fs.rename(req.file.path, path.join(config.target, req.file.originalname));
33-
res.send('OK');
32+
fs.rename(req.file.path, path.join(config.target, req.file.originalname), () => {
33+
res.send('OK');
34+
});
3435
});
3536

3637
app.get('/', (req, res) => {

0 commit comments

Comments
 (0)