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

Method getEndpoint

backend/src/upload/upload.service.ts:47–62  ·  view source on GitHub ↗

* Get the S3 endpoint URL based on configuration * Constructs the endpoint from account ID if not explicitly provided * @returns The S3 endpoint URL string

()

Source from the content-addressed store, hash-verified

45 * @returns The S3 endpoint URL string
46 */
47 private getEndpoint(): string {
48 const s3Config = this.configService.s3Config;
49
50 // Use explicit endpoint if provided
51 if (s3Config.endpoint) {
52 return s3Config.endpoint;
53 }
54
55 // Construct endpoint from account ID for Cloudflare R2
56 if (s3Config.accountId) {
57 return `https://${s3Config.accountId}.r2.cloudflarestorage.com`;
58 }
59
60 // Fallback to default Cloudflare endpoint (should not reach here if hasS3Configured is properly checked)
61 return 'https://r2.cloudflarestorage.com';
62 }
63
64 /**
65 * Upload a file to either S3/Cloudflare R2 or local storage based on configuration

Callers 2

constructorMethod · 0.95
getBucketUrlMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected