wtf
This commit is contained in:
parent
72a7841748
commit
37ac187e6e
0
.env.example
Normal file
0
.env.example
Normal file
@ -3,6 +3,6 @@ import { redirect } from '@sveltejs/kit';
|
|||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Handle} */
|
/** @type {import('@sveltejs/kit').Handle} */
|
||||||
export async function handle({ event, resolve }) {
|
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);
|
return resolve(event);
|
||||||
}
|
}
|
@ -1,5 +1,7 @@
|
|||||||
|
import { env as e } from '$env/dynamic/public'
|
||||||
|
|
||||||
export const env = {
|
export const env = {
|
||||||
api_url: "http://localhost:3000",
|
api_url: e.PUBLIC_API_URL || "",
|
||||||
youpage: "http://localhost:3002",
|
frontend_url: e.PUBLIC_FRONTEND_URL || "",
|
||||||
sites_host: "127.0.0.1.nip.io:3001"
|
sites_url: e.PUBLIC_SITES_URL || ""
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ import { env } from "$lib";
|
|||||||
export async function load(event) {
|
export async function load(event) {
|
||||||
let res = await event.fetch(env.api_url + "/blog");
|
let res = await event.fetch(env.api_url + "/blog");
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
redirect(302, env.youpage);
|
redirect(302, env.frontend_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
let blog_info = await res.json();
|
let blog_info = await res.json();
|
||||||
|
Loading…
Reference in New Issue
Block a user