054e3635f3
The plan is to adopt a sidecar model where files are written to disk then transcoded by a sidecar written in rust where they will then be written to another location (ie. Backblaze B2, S3, NFS)
22 lines
654 B
TypeScript
22 lines
654 B
TypeScript
import type { Handle } from '@sveltejs/kit';
|
|
|
|
import { env } from '$env/dynamic/private';
|
|
|
|
import { auth } from '$lib/server/lucia';
|
|
import { LocalFileStore } from '$lib/server/storage/local';
|
|
import { DatabasePrisma } from '$lib/server/db/prisma';
|
|
|
|
const localFileStore = new LocalFileStore(env.FILE_BASE_PATH, env.FILE_EXTENSION);
|
|
const prismaClient = new DatabasePrisma(env.DATABASE_URL);
|
|
|
|
export const handle: Handle = async ({ event, resolve }) => {
|
|
event.locals = {
|
|
auth,
|
|
authReq: auth.handleRequest(event),
|
|
database: prismaClient,
|
|
writeStore: localFileStore,
|
|
readStore: localFileStore
|
|
};
|
|
|
|
return await resolve(event);
|
|
};
|