Image uploader to Capella
npm install @codexteam/capella-pics --save
constCapella=require('@codexteam/capella-pics');letcapella=newCapella();// upload by URLcapella.uploadFileByURL('https://capella.pics/public/app/capella-logo.png',function(resp){console.log(resp);});// upload from local pathcapella.uploadFile('C:/Users/Capella/Desktop/capella-logo.png',function(resp){console.log(resp);});Return Capella response object if everything is ok, otherwise returns Error message.
Callback argument description
On error
{
"success": false,
"message": <message>
}
On success
{
"success": true,
"message": <message>,
"id": <id>,
"url": <url>
}
You can pass a custom endpoint address to the constructor.
let capella = new Capella({
endpoint: 'https://capella.pics/upload'
});