undo zod env due to stuff breaking

pull/3/head
TZGyn 2 years ago
parent 21d9e4e29c
commit 8a6823af19
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -1,7 +1,6 @@
import { drizzle } from 'drizzle-orm/postgres-js' import { drizzle } from 'drizzle-orm/postgres-js'
import postgres from 'postgres' import postgres from 'postgres'
import * as schema from './schema' import * as schema from './schema'
import { env } from '$lib/env'
const client = postgres(env.DATABASE_URL) const client = postgres(Bun.env.DATABASE_URL ?? '')
export const db = drizzle(client, { schema }) export const db = drizzle(client, { schema })

@ -1,9 +1,8 @@
import { env } from '$lib/env'
import { drizzle } from 'drizzle-orm/postgres-js' import { drizzle } from 'drizzle-orm/postgres-js'
import { migrate } from 'drizzle-orm/postgres-js/migrator' import { migrate } from 'drizzle-orm/postgres-js/migrator'
import postgres from 'postgres' import postgres from 'postgres'
const sql = postgres(env.DATABASE_URL, { max: 1 }) const sql = postgres(Bun.env.DATABASE_URL ?? '', { max: 1 })
const db = drizzle(sql) const db = drizzle(sql)
await migrate(db, { migrationsFolder: 'drizzle' }) await migrate(db, { migrationsFolder: 'drizzle' })

@ -1,4 +1,3 @@
import { env } from '$lib/env'
import type { LayoutServerLoad } from './$types' import type { LayoutServerLoad } from './$types'
export const load = (async (event) => { export const load = (async (event) => {
@ -7,7 +6,7 @@ export const load = (async (event) => {
const breadcrumbs = [{ name: 'Home', path: '/' }] const breadcrumbs = [{ name: 'Home', path: '/' }]
return { return {
shortener_url: env.PUBLIC_SHORTENER_URL, shortener_url: Bun.env.PUBLIC_SHORTENER_URL ?? '',
user: user, user: user,
breadcrumbs, breadcrumbs,
} }

@ -4,9 +4,8 @@ import { eq } from 'drizzle-orm'
import type { RequestHandler } from './$types' import type { RequestHandler } from './$types'
import QRCode from 'qrcode' import QRCode from 'qrcode'
import { redirect } from '@sveltejs/kit' import { redirect } from '@sveltejs/kit'
import { env } from '$lib/env'
const shortenerUrl = env.PUBLIC_SHORTENER_URL const shortenerUrl = Bun.env.PUBLIC_SHORTENER_URL ?? ''
export const GET: RequestHandler = async (event) => { export const GET: RequestHandler = async (event) => {
const shortenerId = event.params.id const shortenerId = event.params.id

Loading…
Cancel
Save