monitors/server/app.js
// This method inspects the *.js files inside the /routes folder and binds the route handlers
This method inspects the *.js files inside the /routes folder and binds the route handlers
This method inspects the * . js files inside the / routes folder and binds the route handlers
function createRoutes() {
	var routesDir = path.join(__dirname, 'routes');
	fs.readdir(routesDir, function (err, files) {
		for (var c = 0; c < files.length; c++) {
			var fileName = files[c];
			if (fileName.substr(fileName.length - 3) === '.js') {
				var filePath = path.join(routesDir, fileName);
				try {
					var item = require(filePath);
					if (item && typeof item.bindRoutes === 'function') {
						item.bindRoutes(app);
					}
				} catch (e) {
					console.error("[app.createRoutes | Error] Filename: ", fileName, " | Error = ", e);
				}
			}
		}
	});
}
function createRoutes ( ) { var routesDir = path . join ( __dirname , 'routes' ) ; fs . readdir ( routesDir , function ( err , files ) { for ( var c = 0 ; c < files . length ; c ++ ) { var fileName = files [ c ] ; if ( fileName . substr ( fileName . length - 3 ) === '.js' ) { var filePath = path . join ( routesDir , fileName ) ; try { var item = require ( filePath ) ; if ( item && typeof item . bindRoutes === 'function' ) { item . bindRoutes ( app ) ; } } catch ( e ) { console . error ( "[app.createRoutes | Error] Filename: " , fileName , " | Error = " , e ) ; } } } } ) ; }
This method inspects the *.js files inside the /routes folder and binds the route handlers
This method inspects the * . js files inside the / routes folder and binds the route handlers