Backend added fallback url env

pull/3/head
TZGyn 2 years ago
parent 1f549ac0c4
commit fa3abc523b
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -2,3 +2,4 @@ host=0.0.0.0
user=postgres
password=password
port=5432
FALLBACK_URL=https://shortener.tzgyn.com

@ -5,6 +5,8 @@ import { createLinkSchema } from './zodSchema'
import { cors } from '@elysiajs/cors'
import { jsonArrayFrom } from 'kysely/helpers/postgres'
const fallback_url = Bun.env.FALLBACK_URL ?? 'https://shortener.tzgyn.com'
const app = new Elysia().use(cors())
app.get('/', () => 'Hello Elysia')
@ -81,7 +83,7 @@ app.get(
set.redirect = shortener[0].link
} catch {
set.redirect = Bun.env.FALLBACK_URL
set.redirect = fallback_url
}
}
)

Loading…
Cancel
Save