]> PHS Git Server - phs-api.git/commitdiff
Fixing closures on app.js file.
authorcharleswrayjr <charleswrayjr@gmail.com>
Mon, 8 Sep 2025 18:51:03 +0000 (13:51 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Mon, 8 Sep 2025 18:51:03 +0000 (13:51 -0500)
app.js
src/controllers/vpn.controller.js

diff --git a/app.js b/app.js
index a79f2300c7a39e2c68d1345c6c70565947171f62..2e0e7618e3069cd13903632d592802328ba42fa5 100755 (executable)
--- a/app.js
+++ b/app.js
@@ -35,6 +35,7 @@ global.phsdb = phsdb;
 global.fs = fs;
 global.sshConfig = sshConfig;
 global.docker = docker;
+global.createError = createError;
 
 // noinspection JSCheckFunctionSignatures
 app.use( bodyParser.json( {
index a0f95c1baae725d75c7fe8d224e7d60f70969732..6faa0d6665efa3379eef5d8d8fec1b27c5434f08 100644 (file)
@@ -1,5 +1,4 @@
 const { Client } = require( 'ssh2' );
-const createError = require('http-errors');
 
 /**
  *
@@ -10,10 +9,6 @@ const parseVpnStatus = ( output ) => {
   // Split once and reuse
   const lines = output.split( '\n' ).map( line => line.trim() ).filter( Boolean );
 
-  const lValues = [ 'lines:', lines ].join( ' ' );
-  logger.debug( lValues );
-  logger.warn( lValues );
-  logger.error( lValues );
   // Find indices using a single pass
   let sIndex = -1, mIndex = -1, eIndex = -1;
   lines.forEach( ( line, i ) => {
@@ -131,6 +126,8 @@ module.exports = {
     } ).connect( sshConfig );
   },
   getClients:async ( req, res, next ) => {
+    const error = new Error( 'Not implemented yet' );
+    next( error );
     const conn = new Client();
     conn.on( 'ready', () => {
       const command = `cat /var/log/openvpn/openvpn-status.log`;