You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how to format response returned to client #634
I would like to re-format the response returned to client.
I know we could use afterRemote hook, but if doing so, I have to do it every single Models, one by one.
Is there any other solution in that I only need to change the code at place and it will be applied to all Models, something likes that ?
// in my-project/server/boot/hook.jsmodule.exports=function(server){varremotes=server.remotes();// modify all returned valuesremotes.after('**',function(ctx,next){ctx.result={data: ctx.result};next();});};
Activity
crandmck commentedon Nov 11, 2014
http://docs.strongloop.com/display/LB/Remote+methods#Remotemethods-Formattingremotemethodresponses
crandmck commentedon Nov 20, 2014
@ritch please review the above section.
ritch commentedon Dec 1, 2014
LGTM