From: charleswrayjr Date: Mon, 8 Sep 2025 18:22:26 +0000 (-0500) Subject: Fixing closures on app.js file. X-Git-Url: https://git.phasecustomsoft.com/?a=commitdiff_plain;h=badeed8f3fbb4279651e891fdf4bdd5d51775318;p=phs-api.git Fixing closures on app.js file. --- diff --git a/app.js b/app.js index 7503355..a79f230 100755 --- a/app.js +++ b/app.js @@ -19,16 +19,16 @@ const sshConfig = { }; const buffer = require('buffer'); -global.Blob = buffer.Blob +global.Blob = buffer.Blob; const app = express(); const http = require( 'http' ).createServer( app ); -app.set('etag', false) +app.set('etag', false); app.use((req, res, next) => { res.set('Cache-Control', 'no-store'); - next() + next(); }); global.phsdb = phsdb; @@ -157,8 +157,8 @@ process.on('unhandledRejection', (err) => { app.use( function ( req, res, next ) { if (req.url === '/.well-known/appspecific/com.chrome.devtools.json' ) next(); else { - logger.debug(req.originalUrl) - logger.debug(req.headers['x-forwarded-for']) + logger.debug(req.originalUrl); + logger.debug(req.headers['x-forwarded-for']); next( createError( 404 ) ); } @@ -227,11 +227,9 @@ const errorHandler = ( err, req, res, next ) => { // render the error page res.status( err.status || 500 ); res.send(err); - } else next() + } else next(); }; app.use( errorHandler ); -console.log('running on ' + port); - module.exports = app;