Code Room
Code reviewMedium
Question
Review this JavaScript request handler doing background work.
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.post("/import", (req, res) => { res.status(202).json({ status: "accepted" }); processImport(req.body).then((r) => { log.info("import done", r); });}); async function processImport(body) { const rows = await parse(body); await db.bulkInsert(rows); return rows.length;}Run or narrate your approach, then ask the coach.