Update plugins/flux.js
Browse files- plugins/flux.js +3 -3
plugins/flux.js
CHANGED
|
@@ -65,7 +65,7 @@ async function downloadAndSaveImage(imageUrl, fileId) {
|
|
| 65 |
}
|
| 66 |
}, 60000);
|
| 67 |
|
| 68 |
-
return
|
| 69 |
}
|
| 70 |
|
| 71 |
const handler = async (req, res) => {
|
|
@@ -103,10 +103,10 @@ const handler = async (req, res) => {
|
|
| 103 |
}
|
| 104 |
|
| 105 |
const fileId = Date.now() + '_' + Math.random().toString(36).substring(7);
|
| 106 |
-
await downloadAndSaveImage(imageUrl, fileId);
|
| 107 |
|
| 108 |
const baseUrl = `${req.protocol}://${req.get('host')}`;
|
| 109 |
-
const localUrl = `${baseUrl}/tmp
|
| 110 |
|
| 111 |
res.json({
|
| 112 |
author: "Herza",
|
|
|
|
| 65 |
}
|
| 66 |
}, 60000);
|
| 67 |
|
| 68 |
+
return `flux-${fileId}.webp`;
|
| 69 |
}
|
| 70 |
|
| 71 |
const handler = async (req, res) => {
|
|
|
|
| 103 |
}
|
| 104 |
|
| 105 |
const fileId = Date.now() + '_' + Math.random().toString(36).substring(7);
|
| 106 |
+
const filename = await downloadAndSaveImage(imageUrl, fileId);
|
| 107 |
|
| 108 |
const baseUrl = `${req.protocol}://${req.get('host')}`;
|
| 109 |
+
const localUrl = `${baseUrl}/tmp/${filename}`;
|
| 110 |
|
| 111 |
res.json({
|
| 112 |
author: "Herza",
|