MCPcopy Create free account
hub / github.com/CodeFox-Repo/codefox / constructor

Method constructor

backend/src/upload/upload.service.ts:21–40  ·  view source on GitHub ↗
(private configService: AppConfigService)

Source from the content-addressed store, hash-verified

19 private readonly mediaDir: string;
20
21 constructor(private configService: AppConfigService) {
22 // Initialize S3 client if configurations are available
23 if (this.configService.hasS3Configured) {
24 const s3Config = this.configService.s3Config;
25 this.s3Client = new S3Client({
26 region: s3Config.region,
27 endpoint: this.getEndpoint(),
28 credentials: {
29 accessKeyId: s3Config.accessKeyId,
30 secretAccessKey: s3Config.secretAccessKey,
31 },
32 });
33 }
34
35 // Initialize media directory for local storage
36 this.mediaDir = path.join(getRootDir(), 'media');
37 if (!existsSync(this.mediaDir)) {
38 mkdirSync(this.mediaDir, { recursive: true });
39 }
40 }
41
42 /**
43 * Get the S3 endpoint URL based on configuration

Callers

nothing calls this directly

Calls 2

getEndpointMethod · 0.95
getRootDirFunction · 0.90

Tested by

no test coverage detected