diff --git a/lib/index.ts b/lib/index.ts index d38f967..478a4d9 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -34,11 +34,11 @@ async function generate(): Promise { const connection = await createConnection({ "type": "postgres", - "host": "localhost", - "port": 5432, - "username": "blog", - "password": "blog", - "database": "blog", + "host": process.env.DB_HOST || "localhost", + "port": process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 5432, + "username": process.env.DB_USERNAME || "blog", + "password": process.env.DB_PASSWORD || "blog", + "database": process.env.DB_DATABASE || "blog", "synchronize": true, "logging": true, "entities": [