{"action":"created","issue":{"url":"https://api.github.com/repos/transloadit/uppy/issues/790","repository_url":"https://api.github.com/repos/transloadit/uppy","labels_url":"https://api.github.com/repos/transloadit/uppy/issues/790/labels{/name}","comments_url":"https://api.github.com/repos/transloadit/uppy/issues/790/comments","events_url":"https://api.github.com/repos/transloadit/uppy/issues/790/events","html_url":"https://github.com/transloadit/uppy/issues/790","id":318539626,"number":790,"title":"S3, Angular 5 Issues??","user":{"login":"gbardwell","id":8060479,"avatar_url":"https://avatars2.githubusercontent.com/u/8060479?v=4","gravatar_id":"","url":"https://api.github.com/users/gbardwell","html_url":"https://github.com/gbardwell","followers_url":"https://api.github.com/users/gbardwell/followers","following_url":"https://api.github.com/users/gbardwell/following{/other_user}","gists_url":"https://api.github.com/users/gbardwell/gists{/gist_id}","starred_url":"https://api.github.com/users/gbardwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbardwell/subscriptions","organizations_url":"https://api.github.com/users/gbardwell/orgs","repos_url":"https://api.github.com/users/gbardwell/repos","events_url":"https://api.github.com/users/gbardwell/events{/privacy}","received_events_url":"https://api.github.com/users/gbardwell/received_events","type":"User","site_admin":false},"labels":[{"id":287347645,"url":"https://api.github.com/repos/transloadit/uppy/labels/QUESTION","name":"QUESTION","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-27T20:27:34Z","updated_at":"2018-05-14T12:34:06Z","closed_at":"2018-05-14T12:34:06Z","author_association":"NONE","body":"I am trying AND failing to add Uppy with AwsS3 to my Angular 5 app.\r\n1) Node/Express backend setup, with an '/api/' :\r\n\r\n```js\r\nconst options = {\r\n    providerOptions: {\r\n    s3: {\r\n      endpoint: process.env.NODECHEF_AwsS3_ENDPOINT,\r\n      getKey: (req, filename) => {\r\n        // console.log(req);\r\n        console.log('/s3/paramas?filename=' + filename);\r\n        return `tmp/${Math.random().toString(32).slice(2)}/${filename}`;\r\n        },\r\n      key: process.env.UPPYSERVER_AWS_KEY,\r\n      secret: process.env.UPPYSERVER_AWS_SECRET,\r\n      bucket: process.env.UPPYSERVER_AWS_BUCKET,\r\n      // region: process.env.UPPYSERVER_AWS_REGION\r\n    }\r\n  },\r\n  server: {\r\n    host: 'localhost:3000/s3'\r\n  },\r\n  filePath: '/tmp/',\r\n  secret: 'blah blah',\r\n  debug: true\r\n};\r\n\r\napp.use(uppy.app(options));\r\n```\r\n\r\n......\r\n\r\nRoutes includes:\r\n```js\r\napp.use('/api', router);\r\n```\r\n\r\nNOTE: \r\nApplication served on port 4200 and '/api/* ' on port 3000\r\n\r\nproxy.conf.json file for the 'ng serve...':\r\n```json\r\n{\r\n  \"/api\": {\r\n    \"target\": \"http://localhost:3000\",\r\n    \"secure\": false\r\n  },\r\n  \"/s3/params\": {\r\n    \"target\": \"http://localhost:3000\",\r\n    \"secure\": false\r\n  }\r\n}\r\n```\r\n\r\n2) Front end:\r\n...uppy config...\r\n\r\n```js\r\n  uppyPlugins = [\r\n    ['Dashboard', {\r\n      trigger: '.UppyModalOpenerBtn',\r\n      replaceTargetContent: true,\r\n      inline: false,\r\n      showProgressDetails: true,\r\n      note: 'Images up to 1 MB',\r\n      height: 470\r\n    }],\r\n    // ['Tus', { endpoint: 'https://master.tus.io/files/' }],\r\n   // ['GoogleDrive', { target: 'Dashboard', host: 'https://server.uppy.io' }],\r\n    // ['Dropbox', { target: 'Dashboard', host: 'https://server.uppy.io' }],\r\n    // ['Instagram', { target: 'Dashboard', host: 'https://server.uppy.io' }],\r\n    ['Url', {target: 'Dashboard', host: 'https://server.uppy.io'}],\r\n    ['AwsS3', {host: 'http://localhost:3000'}]\r\n  ];\r\n```\r\n\r\n3) On server log:\r\n\r\n```\r\n[3] uppy: 2018-04-27T20:20:00.831Z [warn] provider.middleware.invalid invalid provider options detected. Provider will not be loaded\r\n[3] uppy: 2018-04-27T20:20:00.832Z [debug] debugLog No session/body attached to req object. Exiting dispatcher.\r\n[3] /s3/paramas?filename=CTA Mockup.JPG\r\n```\r\n\r\n4) Browser console:\r\n\r\n```\r\npopup-edit:1 Failed to load http://localhost:3000/s3/params?filename=CTA%20Mockup.JPG&type=image%2Fjpeg: **No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.**\r\npopup-editor.component.ts:58 upload-error\r\npopup-editor.component.ts:58 complete\r\npopup-editor.component.ts:61 {successful: Array(0), failed: Array(1), uploadID: \"cjgieiqug00013e6h8u0e2ff0\"}\r\nindex.js:222 TypeError: Cannot read property 'uploadStarted' of undefined\r\n    at eval (index.js:409)\r\n    at Array.filter (<anonymous>)\r\n    at Dashboard.render (index.js:408)\r\n    at Dashboard.updateUI (Plugin.js:80)\r\n    at Dashboard.update (Plugin.js:55)\r\n    at eval (Core.js:169)\r\n    at Array.forEach (<anonymous>)\r\n    at eval (Core.js:910)\r\n    at Array.forEach (<anonymous>)\r\n    at Uppy.iteratePlugins (Core.js:909)\r\n```\r\n\r\nLastly, the browser Network response:\r\nhttp://localhost:3000/s3/params?filename=CTA%20Mockup.JPG&type=image%2Fjpeg\r\n\r\nreturns exacly what I would expect...\r\n```json\r\n{\"method\":\"post\",\"url\":\"https://oss.nodechef.com/saturn\",\"fields\":{\"acl\":\"public-read\",\"key\":\"tmp/uqm46baflo8/CTA Mockup.JPG\",\"success_action_status\":\"201\",\"content-type\":\"image/jpeg\",\"bucket\":\"saturn\",\"X-Amz-Algorithm\":\"AWS4-HMAC-SHA256\",\"X-Amz-Credential\":\"[FILTERED]/s3/aws4_request\",\"X-Amz-Date\":\"20180427T202015Z\",\"Policy\":\"[FILTERED]\",\"X-Amz-Signature\":\"[FILTERED]\"}}\r\n```\r\n\r\nSo...any suggestions to get past the \"No 'Access-Control-Allow-Origin...\" issues?\r\n\r\nThanks,\r\nGreg\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/transloadit/uppy/issues/comments/388800678","html_url":"https://github.com/transloadit/uppy/issues/790#issuecomment-388800678","issue_url":"https://api.github.com/repos/transloadit/uppy/issues/790","id":388800678,"user":{"login":"goto-bus-stop","id":1006268,"avatar_url":"https://avatars1.githubusercontent.com/u/1006268?v=4","gravatar_id":"","url":"https://api.github.com/users/goto-bus-stop","html_url":"https://github.com/goto-bus-stop","followers_url":"https://api.github.com/users/goto-bus-stop/followers","following_url":"https://api.github.com/users/goto-bus-stop/following{/other_user}","gists_url":"https://api.github.com/users/goto-bus-stop/gists{/gist_id}","starred_url":"https://api.github.com/users/goto-bus-stop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goto-bus-stop/subscriptions","organizations_url":"https://api.github.com/users/goto-bus-stop/orgs","repos_url":"https://api.github.com/users/goto-bus-stop/repos","events_url":"https://api.github.com/users/goto-bus-stop/events{/privacy}","received_events_url":"https://api.github.com/users/goto-bus-stop/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T12:34:06Z","updated_at":"2018-05-14T12:34:06Z","author_association":"MEMBER","body":"looks like this is superseded by #803"}}
{"actor":{"display_login":"goto-bus-stop"}}