static async create(api) {
        if (api.database instanceof Database && api.dynamicControllers instanceof DynamicControllers) {
            this.api = api;
            let rtr = new DynamicRoutes();
            utils.logdebug(`* Generating Express routes`);
            rtr.database = api.database;
            rtr.router = Express.Router();
            rtr.dynamicControllers = api.dynamicControllers;
            await Promise.all(Object.values(api.database.tables).map(rtr.create,rtr));
            // add root info path
            rtr.router.get('/', (req,res) => {
                let out = rtr.getApiInfo();
                res.status(200).send(out);
                utils.logdebug('Requested Info url: '+req.originalUrl)
            } );

            return rtr;
        } else {
            console.error("Failed creating Express routes");
            return null;
        }
    }
/**
     * Creates DynamicRoutes object, generate routes from database schema
     * @param {DynamicApi} api 
     * @returns {DynamicRoutes}
     */
Creates DynamicRoutes object, generate routes from database schema
@param {DynamicApi} api
@returns {DynamicRoutes}
Creates DynamicRoutes object generate routes from database schema @param { DynamicApi } api @returns { DynamicRoutes }
static async create(api) {
        if (api.database instanceof Database && api.dynamicControllers instanceof DynamicControllers) {
            this.api = api;
            let rtr = new DynamicRoutes();
            utils.logdebug(`* Generating Express routes`);
            rtr.database = api.database;
            rtr.router = Express.Router();
            rtr.dynamicControllers = api.dynamicControllers;
            await Promise.all(Object.values(api.database.tables).map(rtr.create,rtr));
            rtr.router.get('/', (req,res) => {
                let out = rtr.getApiInfo();
                res.status(200).send(out);
                utils.logdebug('Requested Info url: '+req.originalUrl)
            } );
            return rtr;
        } else {
            console.error("Failed creating Express routes");
            return null;
        }
    }
static async create ( api ) { if ( api . database instanceof Database && api . dynamicControllers instanceof DynamicControllers ) { this . api = api ; let rtr = new DynamicRoutes ( ) ; utils . logdebug ( ` ` ) ; rtr . database = api . database ; rtr . router = Express . Router ( ) ; rtr . dynamicControllers = api . dynamicControllers ; await Promise . all ( Object . values ( api . database . tables ) . map ( rtr . create , rtr ) ) ; rtr . router . get ( '/' , ( req , res ) => { let out = rtr . getApiInfo ( ) ; res . status ( 200 ) . send ( out ) ; utils . logdebug ( 'Requested Info url: ' + req . originalUrl ) } ) ; return rtr ; } else { console . error ( "Failed creating Express routes" ) ; return null ; } }
Creates DynamicRoutes object, generate routes from database schema
 @param {DynamicApi} api
 @returns {DynamicRoutes}
Creates DynamicRoutes object generate routes from database schema @param { DynamicApi } api @returns { DynamicRoutes }
// add root info path