All planetposen routes at version 0.1

This commit is contained in:
2022-11-28 20:03:23 +01:00
parent c76732e6e7
commit 7fdfa1ab15
48 changed files with 3534 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { dev } from '$app/environment';
import { env } from '$env/dynamic/private';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ fetch, params }) => {
const { id } = params;
let url = `/api/product/${id}`;
if (dev || env.API_HOST) {
url = (env.API_HOST || 'http://localhost:30010').concat(url);
}
const res = await fetch(url);
const product = await res.json();
return product;
};