Skip to content

Commit

Permalink
refactor: image upload to S3 (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
BEdev24 authored Sep 10, 2024
1 parent bf33164 commit 998fbec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions backend/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ [email protected]
NAME_FROM=Example Name From

#minio
MINIO_ENDPOINT=minio
MINIO_ENDPOINT=localhost
MINIO_PORT=9000
MINIO_ACCESS_KEY=minio
MINIO_SECRET_KEY=minio123
MINIO_USE_SSL=false
MINIO_BUCKET=cc-portal
MINIO_FILE_UPLOAD_ADDRESS=http://209.38.192.168:9000/cc-portal

S3_BASE_URL=http://localhost:9000

# IPFS Service
IPFS_SERVICE_URL=http://ipfs-service:3001
Expand Down
2 changes: 1 addition & 1 deletion backend/src/s3/service/s3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class S3Service {
fileName: string,
): Promise<string> {
const fullName = this.getFullFileName(context, fileName);
const fileUrl = `http://${this.configService.get('MINIO_ENDPOINT')}:${this.configService.get('MINIO_PORT')}/${this.bucketName}/${fullName}`;
const fileUrl = `${this.configService.get('S3_BASE_URL')}/${this.bucketName}/${fullName}`;
return fileUrl;
}

Expand Down

0 comments on commit 998fbec

Please sign in to comment.