redirect backend changed database env to use connection string

pull/3/head
TZGyn 2 years ago
parent b351f7fb33
commit cbcad8198b
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -1,6 +1,2 @@
PGHOST=0.0.0.0
PGPORT=5432
PGUSER=postgres
PGPASSWORD=password
PGDATABASE=link-shortener
FALLBACK_URL=https://shortener-svelte.tzgyn.com
DATABASE_URL=postgres://postgres:password@0.0.0.0:5432/link-shortener

@ -4,11 +4,9 @@ import { Kysely, PostgresDialect } from 'kysely'
const dialect = new PostgresDialect({
pool: new Pool({
database: Bun.env.PGDATABASE ?? 'link-shortener',
host: Bun.env.PGHOST ?? '0.0.0.0',
user: Bun.env.PGUSER ?? 'postgres',
password: Bun.env.PGPASSWORD ?? 'password',
port: parseInt(Bun.env.PGPORT ?? '') ?? 5432,
connectionString:
Bun.env.DATABASE_URL ??
'postgres://postgres:password@0.0.0.0:5432/link-shortener',
max: 10,
}),
})

Loading…
Cancel
Save