Closed danswater closed 8 years ago
Do you call the callback in your init action? Init actions have the same signature like every action afaik.
Also try to wrap you call of createFile
in seneca.ready(function (err) { ... }
.
I updated the init action
function init ( msg, reply ) {
cloudinary.config( { ... } );
reply();
}
and also invoking createFile
inside seneca.ready
but still I got the same error.
I suspect that this line of code seneca throws an error
cloudinary.uploader.upload( msg.data.StringImage, function ( res ) {
reply( null, res );
} );
because when I try to remove the cloudinary and calling reply( null, { 'res' : 'testing' )
instead it actually works fine.
And you are sure your init action gets called? Because the plugin name differs. Try this
seneca.add( {init:plugin}, init );
@indr , Thank you for figuring out my mistake! :)
I initially name my plugin to files
and then eventually rename it to fileManager
but I forgot to renamed this part seneca.add( {init:files}, init )
.
@danswater My pleasure :smile:
I'm closing this issue now. Seneca rocks!
What I'm trying to do is I want to create a service that will upload some images to cloudinary, cloudinary provides an SDK for uploading images to their server.
So this is what my code looks like
And I tried to call this service for testing
Everytime I run the code above seneca always throw this error.
Can someone point me out what is wrong with this one?
Thanks