update env

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

@ -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,
})

@ -55,7 +55,7 @@ app.listen(3000)
console.log(
`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`,
`${Bun.env.database}`
`${Bun.env.PGDATABASE}`
)
export type App = typeof app

Loading…
Cancel
Save