The serverless example for companion deploys just fine to AWS, but the uploads don't work for Google, Dropbox, etc. because of CORS issues:
Access to fetch at 'https://myprefix.execute-api.us-west-2.amazonaws.com/dev/drive/list/root' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field uppy-auth-token is not allowed by Access-Control-Allow-Headers in preflight response.
I've even tried this to no avail in my serverless.yml:
functions:
uppy:
handler: index.uppy
events:
- http:
path: /
method: ANY
cors: true
- http:
path: /{proxy+}
method: ANY
cors: true
But doesn't seem to make a difference. Has anyone got this to work?
I ran into this issue just this week using the latest companion release. Has there been any progress on this? If not, are there any workarounds?
Thanks.
Hi there, we have removed the Serverless example from our repo as we could not get it to work (reliably) and were losing too much time trying to do so. We鈥檙e happy to accept community contributions in this regard but until it鈥檚 in a better state, thought to not keep sending people astray. Very sorry that this still happened to you. What鈥檚 the reference you were using? Then we can remove that too.
I actually set up the companion to run on Lambda using the Serverless examples months ago for direct to S3 multipart upload signing (and it works flawlessly). I've only just now gotten around to adding support for Dropbox and Google Drive. So I haven't been using any current reference specific to running serverlessly, I've only been following the standard documentation on how to add Dropbox support to the Uppy Dashboard component.
If I come up with a solution that works, I'll be sure to submit a PR.