Code Room
Code reviewMedium
Question
Review this Node endpoint that proxies a file download.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
app.get("/files/:id", async (req, res) => { const obj = await s3.getObject({ Bucket: BK, Key: req.params.id }).promise(); const body = obj.Body; // entire object buffered in memory res.setHeader("Content-Type", obj.ContentType); res.setHeader("Content-Length", body.length); res.send(body);});Run or narrate your approach, then ask the coach.