How to return a complex JSON response with Node.js? February 1, 2023 by Tarik On express 3 you can use directly res.json({foo:bar}) res.json({ msgId: msg.fileName }) See the documentation