create-elysiajs
Version:
Scaffolding your Elysia project with the environment with easy!
38 lines (35 loc) • 1.12 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getS3ServiceFile = getS3ServiceFile;
const ts_dedent_1 = __importDefault(require("ts-dedent"));
function getS3ServiceFile({ s3Client }) {
if (s3Client === "Bun.S3Client") {
return (0, ts_dedent_1.default /* ts */) `
import { S3Client } from "bun";
import { config } from "../config.ts";
export const s3 = new S3Client({
endpoint: config.S3_ENDPOINT,
accessKeyId: config.S3_ACCESS_KEY_ID,
secretAccessKey: config.S3_SECRET_ACCESS_KEY,
});
`;
}
if (s3Client === "@aws-sdk/client-s3") {
return (0, ts_dedent_1.default /* ts */) `
import { S3Client } from "@aws-sdk/client-s3";
import { config } from "../config.ts";
export const s3 = new S3Client({
endpoint: config.S3_ENDPOINT,
region: "minio",
credentials: {
accessKeyId: config.S3_ACCESS_KEY_ID,
secretAccessKey: config.S3_SECRET_ACCESS_KEY,
},
});
`;
}
return "";
}