Reputation: 9
app.use("/assets", express.static(path.join(\__dirname, "public/assets")));
const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, "public/assets");
},
filename: function (req, file, cb) {
cb(null, file.originalname);
},
});
const upload = multer({ storage });
app.post("/auth/register", upload.single("picture"), register);
Upvotes: 0
Views: 23
Reputation: 1
If you are using jade add the image to the HTML like this,
img(src='/assets/Screenshot 2024-02-11 003339.png', alt='Image')
Upvotes: 0