This commit is contained in:
2023-12-05 18:24:45 +05:00
parent edcd51599c
commit f198ff9dfe
29 changed files with 632 additions and 559 deletions
+3 -3
View File
@@ -41,15 +41,15 @@ router.post("/", upload.single("file"), async (req, res) => {
await sharp(req.file.buffer)
.resize({
width: 512,
height: 512,
width: 728,
height: 728,
fit: "inside",
withoutEnlargement: true,
})
.jpeg({ quality: 90 })
.toFile(`uploads/${filename}`);
return res.json({ file: `http://192.168.1.170:3000/upload/${filename}` });
return res.json({ file: `http://192.168.1.171:3000/upload/${filename}` });
} catch (error) {
if (error instanceof Error) {
return res.json({ error: error.message });