static async configureCustomRoutes(app, customRoutes) {
        // eslint-disable-next-line new-cap
        let router = express.Router();
        customRoutes.forEach(route => {
            if(!route.method || !route.relativePath || !route.handler) {
                console.log("ERROR", "Missing parameters from custom route.");
            }

            const url = `/api/v1/custom${route.relativePath}`;
            router[route.method.toLowerCase()](url, async(req, res, next) => {
                const permKey = `CUSTOM:${route.relativePath}:${route.method.toUpperCase()}`;
                if(!route.ignorePermissions && (!res.locals.user || !(await res.locals.user.hasPermission(permKey)))) {
                    console.log("ERROR", `User [${res.locals.user}] does not have permission to access [${url}]; required permission = [${permKey}]`);
                    return res.json({success: false, error: "INVALID_PERMISSION"});
                }

                return route.handler(req, res, next);
            });
            console.log("INFO", `Successfully registered custom route [${route.method.toUpperCase()}][${url}]@[CUSTOM]`);
        });
        app.use(router);
    }
/**
     * Initializes and registers a custom-route array on the specified express app
     * @param {express.Application} app
     * @param {*} customRoutes
     */
Initializes and registers a custom-route array on the specified express app
@param {express.Application} app
@param {*} customRoutes
Initializes and registers a custom - route array on the specified express app @param { express . Application } app @param { * } customRoutes
static async configureCustomRoutes(app, customRoutes) {
        let router = express.Router();
        customRoutes.forEach(route => {
            if(!route.method || !route.relativePath || !route.handler) {
                console.log("ERROR", "Missing parameters from custom route.");
            }
            const url = `/api/v1/custom${route.relativePath}`;
            router[route.method.toLowerCase()](url, async(req, res, next) => {
                const permKey = `CUSTOM:${route.relativePath}:${route.method.toUpperCase()}`;
                if(!route.ignorePermissions && (!res.locals.user || !(await res.locals.user.hasPermission(permKey)))) {
                    console.log("ERROR", `User [${res.locals.user}] does not have permission to access [${url}]; required permission = [${permKey}]`);
                    return res.json({success: false, error: "INVALID_PERMISSION"});
                }
                return route.handler(req, res, next);
            });
            console.log("INFO", `Successfully registered custom route [${route.method.toUpperCase()}][${url}]@[CUSTOM]`);
        });
        app.use(router);
    }
static async configureCustomRoutes ( app , customRoutes ) { let router = express . Router ( ) ; customRoutes . forEach ( route => { if ( ! route . method || ! route . relativePath || ! route . handler ) { console . log ( "ERROR" , "Missing parameters from custom route." ) ; } const url = ` ${ route . relativePath } ` ; router [ route . method . toLowerCase ( ) ] ( url , async ( req , res , next ) => { const permKey = ` ${ route . relativePath } ${ route . method . toUpperCase ( ) } ` ; if ( ! route . ignorePermissions && ( ! res . locals . user || ! ( await res . locals . user . hasPermission ( permKey ) ) ) ) { console . log ( "ERROR" , ` ${ res . locals . user } ${ url } ${ permKey } ` ) ; return res . json ( { success : false , error : "INVALID_PERMISSION" } ) ; } return route . handler ( req , res , next ) ; } ) ; console . log ( "INFO" , ` ${ route . method . toUpperCase ( ) } ${ url } ` ) ; } ) ; app . use ( router ) ; }
Initializes and registers a custom-route array on the specified express app
 @param {express.Application} app
 @param {*} customRoutes
Initializes and registers a custom - route array on the specified express app @param { express . Application } app @param { * } customRoutes
// eslint-disable-next-line new-cap