u
This commit is contained in:
@@ -2,6 +2,8 @@ import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
// #region Helpers
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const CRASH_DUMP_DIR = process.env.CRASH_DUMP_DIR || path.resolve(__dirname, '../../../logs/crash-dumps');
|
||||
@@ -11,6 +13,8 @@ function telemetryErrorStatus(error) {
|
||||
return 500;
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
/**
|
||||
* Registers public telemetry endpoints (no session/cookie auth required).
|
||||
* @param {import('express').Application} app
|
||||
@@ -73,6 +77,8 @@ export function register(app, basePath = '') {
|
||||
* error:
|
||||
* type: string
|
||||
*/
|
||||
// #region POST /public/telemetry/crash
|
||||
|
||||
const routePaths = [`${basePath}/public/telemetry/crash`];
|
||||
if (basePath && !routePaths.includes('/public/telemetry/crash')) {
|
||||
routePaths.push('/public/telemetry/crash');
|
||||
@@ -106,4 +112,6 @@ export function register(app, basePath = '') {
|
||||
res.status(status).json({ error: error.message || 'Internal server error' });
|
||||
}
|
||||
});
|
||||
|
||||
// #endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user