digital ocean spaces/aws S3 integratoin

This commit is contained in:
Daniel
2023-07-01 17:41:39 +03:30
parent 9cf3b78ba1
commit 04a92dae37
20 changed files with 1330 additions and 78 deletions
+14
View File
@@ -0,0 +1,14 @@
import fs from "fs";
import path from "path";
import s3Client from "./s3Client";
export default function createFolder({ filePath }: { filePath: string }) {
if (s3Client) {
// Do nothing, S3 builds files recursively
} else {
const storagePath = process.env.STORAGE_FOLDER;
const creationPath = path.join(process.cwd(), storagePath + "/" + filePath);
fs.mkdirSync(creationPath, { recursive: true });
}
}