use strapi client, use locals for strapi url
All checks were successful
Deployment / Deploy website (push) Successful in 2m56s
Deployment / Deploy strapi (push) Successful in 3m21s

This commit is contained in:
Benjamin Palko 2025-05-06 11:53:45 -04:00
parent 817c3a78ac
commit 0e94cb95ca
11 changed files with 144 additions and 110 deletions

View file

@ -1,4 +1,5 @@
import type { HandleServerError } from '@sveltejs/kit';
import { env } from '$env/dynamic/private';
import type { Handle, HandleServerError } from '@sveltejs/kit';
import { randomUUID } from 'crypto';
export const handleError: HandleServerError = async ({ error, event, message, status }) => {
@ -11,3 +12,10 @@ export const handleError: HandleServerError = async ({ error, event, message, st
errorId
};
};
export const handle: Handle = async ({ event, resolve }) => {
event.locals.Strapi.url = `http://${env.STRAPI_HOST}:${env.STRAPI_PORT}`;
const response = await resolve(event);
return response;
};