This document assumes that you have a working nodejs setup in place.
npm install --save minio
git clone https://github.com/minio/minio-jscd minio-jsnpm installnpm install -g
You need five items in order to connect to Minio object storage server.
|endPoint||URL to object storage service.|
|port||TCP/IP port number. This input is optional. Default value set to
|accessKey||Access key is like user ID that uniquely identifies your account.|
|secretKey||Secret key is the password to your account.|
|secure||Set this value to 'true' to enable secure (HTTPS) access|
var Minio =var minioClient =endPoint: 'play.minio.io'port: 9000secure: trueaccessKey: 'Q3AM3UQ867SPQQA43P2F'secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG';
This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.
We will use the Minio server running at https://play.minio.io:9000 in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
var Minio =// Instantiate the minio client with the endpoint// and access keys as shown below.var minioClient =endPoint: 'play.minio.io'port: 9000secure: trueaccessKey: 'Q3AM3UQ867SPQQA43P2F'secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG';// File that needs to be uploaded.var file = '/tmp/photos-europe.tar'// Make a bucket called europetrip.minioClient;
node file-uploader.jsBucket created successfully in "us-east-1".mc ls play/europetrip/[2016-05-25 23:49:50 PDT] 17MiB photos-europe.tar
The full API Reference is available here.