SSL-Sniffer/src/hooks.server.ts

35 lines
940 B
TypeScript
Raw Normal View History

2025-06-28 17:07:53 +00:00
import type { ServerInit } from '@sveltejs/kit';
2025-06-30 11:53:53 +00:00
import { handles } from './handles/handle';
import { SSLSnifferApp } from '$lib/db-utils/sqlite';
import { UserApp } from '$lib/classes/users';
import { UserDBBroker } from '$lib/db-utils/Users';
import { SessionApp } from '$lib/classes/sessions';
import { SessionDBBroker } from '$lib/db-utils/Sessions';
import { AppData } from '$lib/classes/app-sessions';
import { logger } from '$lib/utils/logger';
let initOnce = false
2025-06-28 17:07:53 +00:00
export const init: ServerInit = async () => {
2025-06-30 11:53:53 +00:00
if (initOnce) {
logger.debug("Already Started, avoiding reinitializing", "App Init")
return
}
logger.debug("Starting app", "App Init")
2025-06-28 17:07:53 +00:00
2025-06-30 11:53:53 +00:00
SSLSnifferApp.init()
UserApp.init(
new UserDBBroker()
)
SessionApp.init(
new SessionDBBroker()
)
2025-06-28 17:07:53 +00:00
2025-06-30 11:53:53 +00:00
initOnce = true
logger.debug("Init run successfully", "App Init")
};
export const handle = handles