2025-01-03 01:04:30 +01:00
|
|
|
|
|
|
|
|
import { User, UserDB, init_db, close_db, create_user, get_user, get_user_db } from "$lib/server/database";
|
|
|
|
|
|
|
|
|
|
import { Database } from "bun:sqlite";
|
|
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
|
|
|
|
|
|
init_db();
|
|
|
|
|
|
|
|
|
|
console.log("started");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deinit() {
|
|
|
|
|
close_db();
|
|
|
|
|
console.log('exit');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
init();
|
|
|
|
|
|
|
|
|
|
process.on('exit', (reason) => {
|
|
|
|
|
deinit();
|
|
|
|
|
process.exit(0);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
process.on('SIGINT', (reason) => {
|
|
|
|
|
console.log("SIGINT")
|
|
|
|
|
process.exit(0);
|
|
|
|
|
})
|
|
|
|
|
|
2025-02-04 21:41:16 +01:00
|
|
|
import { getAllFiles } from "$lib/server/docstore"
|
2025-01-03 01:04:30 +01:00
|
|
|
|
|
|
|
|
export async function handle({ event, resolve }) {
|
|
|
|
|
|
|
|
|
|
event.locals.user = get_user();
|
|
|
|
|
console.log("handle");
|
|
|
|
|
|
|
|
|
|
return await resolve(event);
|
|
|
|
|
}
|