@codexteam/capella-pics

1.0.2 • Public • Published

capella.nodejs

Image uploader to Capella

Installation

npm install @codexteam/capella-pics --save

Usage

const Capella = require('@codexteam/capella-pics');

let capella = new Capella();

// upload by URL
capella.uploadFileByURL('https://capella.pics/public/app/capella-logo.png', function (resp) {
    console.log(resp);
});

// upload from local path
capella.uploadFile('C:/Users/Capella/Desktop/capella-logo.png', function (resp) {
    console.log(resp);
});

Response

Return Capella response object if everything is ok, otherwise returns Error message.

Response format

Callback argument description

On error

{
   "success": false,
   "message": <message>
}

On success

{
   "success": true,
   "message": <message>,
   "id": <id>,
   "url": <url>
}

Custom endpoint

You can pass a custom endpoint address to the constructor.

let capella = new Capella({
    endpoint: 'https://capella.pics/upload'
});

License

MIT

Package Sidebar

Install

npm i @codexteam/capella-pics

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

8.08 kB

Total Files

5

Last publish

Collaborators

  • slaveeks
  • dsnostr
  • codex-team
  • khaydarovm