feat(infisical-pg): added e2e test setup

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:22 +05:30
parent 3670b16657
commit 1df7b88abf
16 changed files with 2854 additions and 46 deletions
+32
View File
@@ -0,0 +1,32 @@
import dotenv from "dotenv";
import { formatSmtpConfig, initEnvConfig } from "./lib/config/env";
import { initLogger } from "./lib/logger";
import { main } from "./server/app";
import { smtpServiceFactory } from "./services/smtp/smtp-service";
import { initDbConnection } from "./db";
dotenv.config();
const run = async () => {
const logger = await initLogger();
const appCfg = initEnvConfig(logger);
const db = initDbConnection(appCfg.DB_CONNECTION_URI);
const smtp = smtpServiceFactory(formatSmtpConfig());
const server = await main({ db, smtp, logger });
process.on("SIGINT", async () => {
await server.close();
await db.destroy();
process.exit(0);
});
process.on("SIGTERM", async () => {
await server.close();
await db.destroy();
process.exit(0);
});
await server.listen({ port: appCfg.PORT, host: appCfg.HOST });
};
run();