3
   import * as Minio from 'minio';
   
   export class MinioClient{
   
       minioClient = new Minio.Client({
           endPoint: '54.223.109.***',
           port: 80,
           secure: true,
           accessKey: '<Redacted>',
           secretKey: '<Redacted>'
       });
       getListBuckets():void{
           this.minioClient.listBuckets(function(err, buckets) {
               if (err) return console.log(err)
               console.log('buckets :', buckets)
               })
           }
    }

This is my code connect to minio server.

I can use js to do it, upload file and download file.

Following is error messages.

> zone.js:2955 XMLHttpRequest cannot load
> webpack-internal:///../../../../minio/dist/main/signing.js. Cross
> origin requests are only supported for protocol schemes: http, data,
> chrome, chrome-extension, https. (anonymous) @ zone.js:2955
> proto.(anonymous function) @ zone.js:1366 (anonymous) @
> source-map-support.js:76 (anonymous) @ source-map-support.js:53
> retrieveSourceMapURL @ source-map-support.js:124 (anonymous) @
> source-map-support.js:141 (anonymous) @ source-map-support.js:53
> mapSourcePosition @ source-map-support.js:171 wrapCallSite @
> source-map-support.js:343 (anonymous) @ source-map-support.js:378
> prepareStackTrace @ source-map-support.js:377

Is that require happened? Does my project limit it? or I miss something.

Raphaël VO
  • 2,413
  • 4
  • 19
  • 32
Jack Chen
  • 31
  • 3
  • posting accessKey and secretKey is not the best idea... – smnbbrv Jan 02 '18 at 12:54
  • when i start project use ng serve ,it has follow warn. WARNING in ./node_modules/source-map-support/source-map-support.js Module not found:Error can't resolve 'module' in ' ./node_module/source-map-supprot' Parsed request is a module. – Jack Chen Jan 03 '18 at 01:20

0 Answers0