File Storage

Burdy comes with support to store content in either file system (default) or AWS S3.

Azure Blob support is coming later this year

To activate AWS S3 update environment variables to:

# File driver config, possible values: fs (default)|aws_s3
FILE_DRIVER=aws_s3

# Will take effect only if aws_s3 value is set for FILE_DRIVER
AWS_ACCESS_KEY_ID=<access_key_id>
AWS_SECRET_ACCESS_KEY=<secret_access_key>
AWS_S3_REGION=<region>
AWS_S3_BUCKET=<bucket>

link.To setup AWS S3 please visit Creating a Bucket.

Using File Driver

To store files from your code, use our File Driver.

To initiate it just call FileDriver.getInstance();

IFileDriver

export interface IFileDriver {
getUpload: () => any;
getName: () => string;

copy: (src: string, dest: string) => Promise<any>;
write: (key: string, content: any) => Promise<any>;
read: (key: string) => Promise<any>;
stat: (key: string) => Promise<any>;
delete: (params: string | string[]) => Promise<any>;

createReadStream: (key: string, options?: any) => any;
createWriteStream: (key: string, options?: any) => any;
}
Copyright © Burdy Technologies. All rights reserved.