1.0.3 • Published 6 years ago

fs-js-client v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

fs-js-client

N|lrucache-nodejs

File Service fs-js-client is a nodejs client for FileService Service. This is the library to consume your Fileservice server services. The server and detailed info you can find in github. N|lrucache-nodejs

About

fs-js-client uses a number of open source projects to work properly:

Installation

Install the dependencies and start the server.

$ npm install fs-js-client --save

Usage

var client = require('fs-js-client').FileService;

const CREDENTIALS = {
    API_KEY: <KEY_GENERATED_FROM_CUSTOM_SERVER>,
    USER: <rabbitmq user>,
    PASS: <rabbitmq client>,
    HOST: <rabbitmq host, example- 192.168.1.153>,
    PORT: <PORT ex: 5672>
};

let service = new client(CREDENTIALS).setBucket("<BUCKET NAME>");

service.uploadFile(<path to file>).then((data) => {
    console.log(data);
});

//upload another file 
service.uploadFile("anotherfile.jpg").then((data) => {
    console.log(data);
});

//upload another file with diffrent bucket
service.setBucket("<NEW BUCKET>").uploadFile("anotherfile.jpg").then((data) => {
    console.log(data); //data.file will give you the file key in server which is used to reference the file.
});

//after upload you will get, 
//http://yourserverip/file/<YOUR BUCKET>/<FILENAME>
//will give you the file.
{
    bucket:<BUCKET NAME>,
    filename:<FILENAME>
}

N|lrucache-nodejs

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago