mirror of https://github.com/TZGyn/shortener
update frontend to use sveltekit env module
parent
86cb005ab1
commit
7d35e8d641
@ -1,6 +1,7 @@
|
||||
import { drizzle } from 'drizzle-orm/postgres-js'
|
||||
import postgres from 'postgres'
|
||||
import * as schema from './schema'
|
||||
import { env } from '$env/dynamic/private'
|
||||
|
||||
const client = postgres(Bun.env.DATABASE_URL ?? '')
|
||||
const client = postgres(env.DATABASE_URL)
|
||||
export const db = drizzle(client, { schema })
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
const envSchema = z.object({
|
||||
DATABASE_URL: z.string().url(),
|
||||
PUBLIC_SHORTENER_URL: z.string(),
|
||||
})
|
||||
|
||||
export const env = envSchema.parse(process.env)
|
||||
Loading…
Reference in New Issue