As title says, how to you write middleware in SvelteKit? I know to do it in hooks.server.ts.
I succeed to intercept server requests, but it would be ideal to make interceptor or middleware for both client and server calls in SvelteKit.
You could potentially handle the fetch
event in a service worker (kit docs).