use strapi client, use locals for strapi url
This commit is contained in:
parent
817c3a78ac
commit
0e94cb95ca
11 changed files with 144 additions and 110 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue