/public files on s3 (or other external storage)

Is it possible to point my meteor app’s “public” folder to an external data source, like an s3 bucket?

Ideally i’d want to just set an environment variable like METEOR_PUBLIC_URL=http://s3.amazonaws.com/bucket/

and have all requests for files come from that bucket. Is something like that possible, or would I have to update all my file urls to pull from an environment variable i.e:


let bucket = Meteor.settings.BUCKET_URL;
<img src={bucket}/image.jpg/>

You need the last solution but clearly you can write a global helper for it if desired.

Problem you will have is that you have to adjust your build process to upload the right version files the you change things so they will actually be available when you deploy a new version of your app. Meteor now takes care of that.