FincH12 commited on
Commit
bd013dc
·
verified ·
1 Parent(s): 72dae7c

Upload health-server.js with huggingface_hub

Browse files
Files changed (1) hide show
  1. health-server.js +15 -0
health-server.js CHANGED
@@ -272,6 +272,8 @@ const server = http.createServer(async (req, res) => {
272
  keepalive: getKeepaliveStatus(),
273
  }),
274
  );
 
 
275
  if (pathname === "/test-telegram") {
276
  const https = require("https");
277
  const reqTelegram = https.get(
@@ -296,6 +298,19 @@ const server = http.createServer(async (req, res) => {
296
  return;
297
  }
298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  // 2. n8n Proxy Logic
300
  const proxyHeaders = {
301
  ...req.headers,
 
272
  keepalive: getKeepaliveStatus(),
273
  }),
274
  );
275
+ }
276
+
277
  if (pathname === "/test-telegram") {
278
  const https = require("https");
279
  const reqTelegram = https.get(
 
298
  return;
299
  }
300
 
301
+ if (pathname === "/test-db") {
302
+ const { exec } = require("child_process");
303
+ exec("sqlite3 /home/node/.n8n/database.sqlite \"SELECT id, name, type FROM credentials_entity;\"", (err, stdout, stderr) => {
304
+ res.writeHead(200, { "Content-Type": "application/json" });
305
+ res.end(JSON.stringify({
306
+ error: err ? err.message : null,
307
+ stdout: stdout.trim(),
308
+ stderr: stderr.trim()
309
+ }));
310
+ });
311
+ return;
312
+ }
313
+
314
  // 2. n8n Proxy Logic
315
  const proxyHeaders = {
316
  ...req.headers,