The SvelteKit `hooks.server.ts` file is a great place to initialize databases. It lets you run code on each server request, adding data that you want to be access in the endpoint logic. It is essentially middleware. Add a `src/hooks.server.ts` file to your project, then export a handle function. Within the body of your handle function, add your database instance to the `event.locals` object. For example, we saw, working with Upstash Redis, you might set `event.locals.redis = new Redis();`. Then, in your `+page.server.ts files`, you will have access to the initialized database instance via the `locals` object.