Closed fbritoferreira closed 7 years ago
Hey! This does not need to be handled by the storage adapter.
You can create the cloudfront link using built-in mongoose hooks
MyModel.schema.pre('save', function(next) {
var field = this.s3file
cloudfront.createDistribution({
}, next);
});
see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFront.html#createDistribution-property and http://mongoosejs.com/docs/middleware.html
@sktt Good shout thats a really easy way of doing it.
It would be nice if we could had a separate cloudfront / cdn link and would pull the files from there.