mirror of https://github.com/TZGyn/shortener
update env
parent
c1f1c81ff0
commit
eed1117ebe
@ -1,6 +1,6 @@
|
||||
host=0.0.0.0
|
||||
user=postgres
|
||||
password=password
|
||||
port=5432
|
||||
database=railway
|
||||
PGHOST=0.0.0.0
|
||||
PGPORT=5432
|
||||
PGUSER=postgres
|
||||
PGPASSWORD=password
|
||||
PGDATABASE=link-shortener
|
||||
FALLBACK_URL=https://shortener-svelte.tzgyn.com
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import { Database } from "./types";
|
||||
import { Pool } from "pg";
|
||||
import { Kysely, PostgresDialect } from "kysely";
|
||||
import { Database } from './types'
|
||||
import { Pool } from 'pg'
|
||||
import { Kysely, PostgresDialect } from 'kysely'
|
||||
|
||||
const dialect = new PostgresDialect({
|
||||
pool: new Pool({
|
||||
database: Bun.env.database ?? "link-shortener",
|
||||
host: Bun.env.host ?? "0.0.0.0",
|
||||
user: Bun.env.user ?? "postgres",
|
||||
password: Bun.env.password ?? "password",
|
||||
port: parseInt(Bun.env.port ?? "") ?? 5432,
|
||||
max: 10,
|
||||
}),
|
||||
});
|
||||
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,
|
||||
max: 10,
|
||||
}),
|
||||
})
|
||||
|
||||
export const db = new Kysely<Database>({
|
||||
dialect,
|
||||
});
|
||||
dialect,
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue