diff --git a/app.js b/app.js index 587f20b..13183ab 100644 --- a/app.js +++ b/app.js @@ -31,6 +31,21 @@ app.get('/script.js', (req, res) => { }); +app.get('/YOUR_IMAGE.jpg', (req, res) => { + const imagePath = __dirname + '/static/YOUR_IMAGE.jpg'; + const imageStats = fs.statSync(imagePath); + const fileSize = imageStats.size; + const imageType = 'image/jpeg'; + + // Set the 'Content-Type' header with the correct MIME type + res.setHeader('Content-Type', imageType); + // Set the 'Content-Length' header with the file size + res.setHeader('Content-Length', fileSize); + // Pipe the image file to the response + const imageStream = fs.createReadStream(imagePath); + imageStream.pipe(res); +}); + app.post('/completions', async (req, res) => { try { const query = req.body.query; diff --git a/static/YOUR_IMAGE.jpg b/static/YOUR_IMAGE.jpg new file mode 100644 index 0000000..7f0d500 Binary files /dev/null and b/static/YOUR_IMAGE.jpg differ diff --git a/static/index.html b/static/index.html index 1bb23f1..248b83c 100644 --- a/static/index.html +++ b/static/index.html @@ -6,14 +6,17 @@ Upload Image - +

+ + Download Sample +
- +

- +