Add session server routes and SessionError class

Introduces new session server endpoints for hasJoined and profile lookup, adds a SessionError class for improved error handling, and updates error exports. Also renames sessionRepository and sessionService files to sessionsRepository and sessionsService for consistency, and sets max listeners in logger.
This commit is contained in:
2025-12-24 02:35:04 +01:00
parent 64d632eac9
commit 80bca31d9a
9 changed files with 82 additions and 8 deletions

View File

@@ -5,6 +5,8 @@ require("dotenv").config({
quiet: true
})
process.setMaxListeners(15)
function cleanup($stream) {
if (!$stream.destroyed) {
$stream.end()
@@ -49,7 +51,7 @@ function createLogger(root) {
}
const stream = fs.createWriteStream(path.join(logsDir, `${fileName}.log`), { flags: "a" })
process.on("exit", () => {
cleanup(stream)
})

View File

@@ -1,5 +1,6 @@
const path = require("node:path")
const Logger = require("./logger")
const crypto = require("node:crypto")
const logger = Logger.createLogger(path.join(__dirname, ".."))
const certificatesManager = require("./certificatesManager")
const serverKeys = certificatesManager.getKeys()