app.post('/users', async (req, res) => {
await userService.createUser(req.body);
res.status(201).send('User created');
});
app.get('/users/:id', async (req, res) => {
const user = await userReadModel.getById(req.params.id);
res.json(user);
});
Key takeaway for interview: What is CQRS (Command Query Responsibility Segregation) and how is it implemented in backend APIs?