As per my understanding, the service-objects that we are registering are invoked by kinvey collections only. Is there any way to test that locally ?
I have written below code.
var sdk = require('kinvey-flex-sdk');
const PORT = 8080;
sdk.service({ host: 'localhost', port: PORT }, function (err, flex) {
const data = flex.data;
function authentication(request, complete, modules) {
console.log("Inside...");
complete().setBody("Authenticated");
};
const widgets = data.serviceObject('widgets');
widgets.onInsert(authentication);
});
And my doubt is authentication function is not triggered for the POST request http://localhost:8080/widgets {}..
Can u please help me in resolving that ?
Thanks in advance..