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