I think that the problem is because api.Users.create()
is an asynchronous function, so return "test"
is actually executed before return myOtherUser
.
See http://wiki.dreamfactory.com/DreamFactory/Tutorials/Node_API_example
Additionally take into account that return myOtherUser
is the return value of the anonymous function that is passed to api.Users.create()
, not the return value of the script.