I'm a nob in expressjs and just using it so I have this response in my controller
....
res.json({
'data': {
'user': {
'id': user.id,
'name': user.name,
'email': user.email,
},
'token': token
}
});
In Laravel, there is something called eloquent-resources that takes the data of something and puts it in a separate class, and arranges this data as you need!
IS there any thing like this in express js