HerzaJ commited on
Commit
16b9dca
·
verified ·
1 Parent(s): 1853ae9

Update plugins/flux.js

Browse files
Files changed (1) hide show
  1. plugins/flux.js +3 -3
plugins/flux.js CHANGED
@@ -65,7 +65,7 @@ async function downloadAndSaveImage(imageUrl, fileId) {
65
  }
66
  }, 60000);
67
 
68
- return filePath;
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/flux-${fileId}.webp`;
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",