upd
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user