tina4-nodejs 3.10.71 → 3.10.72
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tina4-nodejs",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.72",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tina4 for Node.js/TypeScript — 54 built-in features, zero dependencies",
|
|
6
6
|
"keywords": ["tina4", "framework", "web", "api", "orm", "graphql", "websocket", "typescript"],
|
|
@@ -1207,9 +1207,21 @@ const handleVersionCheck: RouteHandler = async (_req, res) => {
|
|
|
1207
1207
|
// Dev Admin JS handler — serves the shared JS file
|
|
1208
1208
|
// ---------------------------------------------------------------------------
|
|
1209
1209
|
|
|
1210
|
-
const handleDevAdminJs: RouteHandler = (_req, res) => {
|
|
1211
|
-
|
|
1212
|
-
|
|
1210
|
+
const handleDevAdminJs: RouteHandler = async (_req, res) => {
|
|
1211
|
+
// Serve the pre-built SPA bundle from public/js/
|
|
1212
|
+
const { readFileSync } = await import("node:fs");
|
|
1213
|
+
const { dirname, join } = await import("node:path");
|
|
1214
|
+
const { fileURLToPath } = await import("node:url");
|
|
1215
|
+
const dir = dirname(fileURLToPath(import.meta.url));
|
|
1216
|
+
const jsPath = join(dir, "..", "public", "js", "tina4-dev-admin.min.js");
|
|
1217
|
+
try {
|
|
1218
|
+
const content = readFileSync(jsPath, "utf-8");
|
|
1219
|
+
res.raw.writeHead(200, { "Content-Type": "application/javascript; charset=utf-8", "Cache-Control": "no-cache" });
|
|
1220
|
+
res.raw.end(content);
|
|
1221
|
+
} catch {
|
|
1222
|
+
res.raw.writeHead(200, { "Content-Type": "application/javascript; charset=utf-8", "Cache-Control": "no-cache" });
|
|
1223
|
+
res.raw.end(renderDevAdminJs());
|
|
1224
|
+
}
|
|
1213
1225
|
};
|
|
1214
1226
|
|
|
1215
1227
|
// ---------------------------------------------------------------------------
|