Skip to content

Commit 1205b9d

Browse files
committed
dev-demo: fix storage adapter on dev-demo
AdminForth/1735/kv-adapters-and-storage-s3-com
1 parent 74f75af commit 1205b9d

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

dev-demo/resources/cars_resources/carsResourseTemplate.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,16 @@ export default function carsResourseTemplate(resourceId: string, dataSource: Car
193193
194194
*********************************************************************************/
195195
new UploadPlugin({
196-
storageAdapter: new AdminForthAdapterS3CompatibleStorage({
197-
accessKeyId: 'minioadmin',
198-
secretAccessKey: 'minioadmin',
199-
endpoint: 'http://localhost:9000',
200-
bucket: 'adminforth-dev-demo',
201-
region: 'us-east-1',
202-
s3ACL: 'private',
203-
cleanupKeyValueAdapter: levelDbAdapter,
204-
forcePathStyle: true,
205-
cleanupCheckInterval: '30m',
206-
cleanupGracePeriod: '5d'
196+
storageAdapter: process.env.USE_S3 !== 'true' ? new AdminForthStorageAdapterLocalFilesystem({
197+
fileSystemFolder: "./db/uploads",
198+
mode: "public", // or "private"
199+
signingSecret: '1241245',
200+
}) : new AdminForthAdapterS3Storage({
201+
bucket: process.env.AWS_BUCKET_NAME as string,
202+
region: process.env.AWS_REGION as string,
203+
accessKeyId: process.env.AWS_ACCESS_KEY_ID as string,
204+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY as string,
205+
s3ACL: "public-read"
207206
}),
208207
pathColumnName: 'photos',
209208
allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif', 'webm', 'webp'],

0 commit comments

Comments
 (0)