request-scope-api 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* RequestScope — Dashboard router (PRODUCTION FIXED ESM)
|
|
3
3
|
*/
|
|
4
4
|
import { Router, static as expressStatic } from "express";
|
|
5
|
-
import path from
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { createRequire } from 'module';
|
|
6
7
|
import { getRecords, getRecordById, deleteAllRecords, } from "./api.js";
|
|
7
8
|
// ---------------------------------------------------------------------------
|
|
8
9
|
// Dashboard path resolver (FIXED)
|
|
9
10
|
// ---------------------------------------------------------------------------
|
|
10
11
|
function getDashboardPath() {
|
|
11
12
|
// @ts-ignore - TypeScript doesn't understand dual-module compilation
|
|
12
|
-
const packageJsonPath =
|
|
13
|
+
const packageJsonPath = createRequire(import.meta.url).resolve("request-scope-api/package.json");
|
|
13
14
|
const packageDir = path.dirname(packageJsonPath);
|
|
14
15
|
return path.join(packageDir, "dist", "dashboard");
|
|
15
16
|
}
|