Skip to content

Commit

Permalink
BE #18 fix relative file path for binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
maruf-cefalo committed May 28, 2020
1 parent 8a1ef76 commit 0231a90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions routes/binaries.route.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const express = require('express');
const router = express.Router();
const multer = require('multer');
const path = require('path');

const BinariesController = require('../controllers/binaries.controller');

// configure DiscStorage engine
const storage = multer.diskStorage({
destination: process.env.FS_UPLOAD_IMAGE,
destination: path.join(__dirname + process.env.FS_UPLOAD_IMAGE),
filename: function (req, file, cb) {
cb(null, file.originalname);
}
Expand All @@ -16,4 +17,4 @@ const upload = multer({storage: storage});

router.post('/images/upload', upload.single('image'), BinariesController.uploadImage);

module.exports = router;
module.exports = router;

0 comments on commit 0231a90

Please sign in to comment.