security: remove hardcoded DB credentials from code files
This commit is contained in:
@@ -7,9 +7,11 @@ const globalForPrisma = globalThis as unknown as {
|
||||
};
|
||||
|
||||
function createPrismaClient(): PrismaClient {
|
||||
const connectionString =
|
||||
process.env.DATABASE_URL ||
|
||||
'postgres://postgres:mBTWE2cDKGExtpktguD3HPe8y9Xr9kWFYdxV4WHQKISLLGoBAS4UdtfSCfXwvPpq@65.109.236.58:37298/postgres';
|
||||
const connectionString = process.env.DATABASE_URL;
|
||||
|
||||
if (!connectionString) {
|
||||
throw new Error('[DB] DATABASE_URL environment variable is not set!');
|
||||
}
|
||||
|
||||
const pool = new Pool({ connectionString });
|
||||
const adapter = new PrismaPg(pool);
|
||||
|
||||
Reference in New Issue
Block a user