Replies: 1 comment
-
// src/hooks.server.ts
import type { Handle } from '@sveltejs/kit';
export const handle: Handle = async ({ event, resolve }) => {
// calling resolve will run your load functions.
// modify event.locals inside your load function
const response = await resolve(event);
// do something with the returned Response
// or use the data from event.locals
return response;
} https://kit.svelte.dev/docs/hooks#server-hooks-handle // +page.server.js
export const load = (event) => {
// modify event.locals
} Hope this works! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to change language of html depending on the fetched content.
How can I pass data from a load function to a handle function???
Beta Was this translation helpful? Give feedback.
All reactions