Hi Thierno,
Welcome to the wonderful world where Codeless meets code. Here’s what you can do to add this functionality:
- Click
Business LogicIn theBACKENDsection of console and switch to theCODINGtab. - Make sure
JSis selected in the drop down, right click theservicesnode in the tree:
- Select
New Fileand enterBase64Service.js. ClickCREATE - Paste the following code in the editor:
class Base64Service
{
/**
* @param {String} data
* @returns {Promise.<String>}
*/
toBase64( data ) {
return Buffer.from( data ).toString('base64')
}
/**
* @param {String} data
* @returns {Promise.<String>}
*/
fromBase64( data ) {
return Buffer.from( data, 'base64' ).toString()
}
}
Backendless.ServerCode.addService( Base64Service );
- Click the button to deploy the service:

- Once deployed, switch to the
API SERVICEStab and try it out by entering some text into thedatafield and clickingINVOKE:
- Now that the service is there and is working, you can start using it in Codeless:
Hope this helps.
Mark


