Skip to content

Commit

Permalink
[#44] Feat: Modify routes to upload-avatar from upload
Browse files Browse the repository at this point in the history
  • Loading branch information
inyeoptti committed Oct 13, 2022
1 parent 238116d commit 0fb490c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/api/routes/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { uploadAvatar } from "../../loaders/multer";

const router = Router();

router.post("/upload", uploadAvatar, (req, res) => {
const { fieldname, originalname, encoding, mimetype, destination, filename, path, size } = req.file
const { name } = req.body;
router.post("/upload-avatar", uploadAvatar, (req, res) => {
const { fieldname, originalname, encoding, mimetype, destination, filename, path, size } = req.file;

res.json({path: `/public/${filename}`});
});
Expand Down

0 comments on commit 0fb490c

Please sign in to comment.