This commit is contained in:
Omer Sabic 2024-05-29 22:42:08 +02:00
parent 72a7841748
commit 37ac187e6e
4 changed files with 7 additions and 5 deletions

0
.env.example Normal file
View File

View File

@ -3,6 +3,6 @@ import { redirect } from '@sveltejs/kit';
/** @type {import('@sveltejs/kit').Handle} */
export async function handle({ event, resolve }) {
if(new URL(event.request.url).host === env.sites_host) redirect(302, env.youpage)
if(new URL(event.request.url).host === env.sites_host) redirect(302, env.frontend_url)
return resolve(event);
}

View File

@ -1,5 +1,7 @@
import { env as e } from '$env/dynamic/public'
export const env = {
api_url: "http://localhost:3000",
youpage: "http://localhost:3002",
sites_host: "127.0.0.1.nip.io:3001"
api_url: e.PUBLIC_API_URL || "",
frontend_url: e.PUBLIC_FRONTEND_URL || "",
sites_url: e.PUBLIC_SITES_URL || ""
}

View File

@ -5,7 +5,7 @@ import { env } from "$lib";
export async function load(event) {
let res = await event.fetch(env.api_url + "/blog");
if (!res.ok) {
redirect(302, env.youpage);
redirect(302, env.frontend_url);
}
let blog_info = await res.json();