You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constexpress=require('express');constpath=require('path');constfs=require('fs');constapp=express();app.get('/rickroll.mp3',(req,res)=>{constfilePath=path.join(__dirname,'rickroll.mp3');fs.stat(filePath,(err,stats)=>{if(err){console.error('Error while getting file stats:',err);res.status(500).send('Error while getting file stats.');return;}res.setHeader('Content-Type','audio/mpeg');res.setHeader('Content-Disposition','attachment; filename="rickroll.mp3"');res.setHeader('Content-Length',stats.size);res.setHeader('Accept-Ranges','bytes');res.sendFile(filePath,(err)=>{if(err){console.error('Error while sending the file:',err);res.status(500).send('Error while sending the file.');}});});});constport=process.env.PORT||3000;app.listen(port,()=>{console.log(`Server is running on port ${port}`);});
The text was updated successfully, but these errors were encountered:
did you ever figure this out? i'm having a similar issue with my webserver
I just ended up using nginx as the webserver and that works, express.js probably is sending the wrong headers and etched interprets it as an audio stream and not a static file
i do wonder what headers if any specific ones etched needs, my webserver is a bunch of messy rust codes so it could also just be a random issue in my code
so i have a webserver in express.js that serves some custom audio files that i want to use on etched tho i get everytime this error:
the server code is this:
The text was updated successfully, but these errors were encountered: