Code Room
Code reviewHard
Question
Review this TypeScript gateway handler that calls an internal payments microservice and relays its result to the public client.
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('/balance', async (req, res) => { const upstream = await fetch( `http://payments-svc/internal/accounts/${req.query.acct}/balance`, ); const data = await upstream.json(); // mirror the internal service's status + body to the client res.status(upstream.status).json(data);});Run or narrate your approach, then ask the coach.