addMasterMiddleware(node) {
        const uib = this.uib

        let mypath
        if ( uib.nodeRoot === '' || uib.nodeRoot === '/' ) mypath = `/${node.url}/`
        else mypath = `${uib.nodeRoot}${node.url}/`

        const qSec = uib.customServer.type === 'https' // true if using https else false

        const that = this

        /**
         * Return a middleware handler
         * @param {express.Request} req Express request object
         * @param {express.Response} res Express response object
         * @param {express.NextFunction} next Express next() function
         */
        function masterMiddleware (req, res, next) {
            // Check for client id from client - if it exists, reuse it otherwise create one
            const clientId = getClientId(req)

            // TODO: X-XSS-Protection only needed for html (and js?), not for css, etc
            res
                // Headers only accessible in the browser via web workers
                .header({
                    // Help reduce risk of XSS and other attacks
                    'X-XSS-Protection': '1;mode=block',
                    'X-Content-Type-Options': 'nosniff',
                    // 'X-Frame-Options': 'SAMEORIGIN',
                    // Content-Security-Policy': "script-src 'self'",
                    // Tell the client that uibuilder is being used (overides the default "ExpressJS" entry)
                    'x-powered-by': 'uibuilder',
                    // Tell the client what Socket.IO namespace to use,
                    'uibuilder-namespace': node.url, // only client accessible from xhr or web worker
                    'uibuilder-node': node.id,
                    // 'uibuilder-path': mypath,
                })
                // .links({
                //     help: '',
                // })
                .cookie('uibuilder-namespace', node.url, {
                    path: mypath,
                    sameSite: true,
                    // @ts-expect-error
                    expires: 0, // session cookie only - expires/maxAge
                    secure: qSec,
                })
                // Give the client a fixed session id
                .cookie('uibuilder-client-id', clientId, {
                    path: mypath,
                    sameSite: true,
                    // @ts-expect-error
                    expires: 0, // session cookie only - expires/maxAge
                    secure: qSec,
                })
                // Tell clients what httpNodeRoot to use (affects Socket.io path)
                .cookie('uibuilder-webRoot', uib.nodeRoot.replace(/\//g, ''), {
                    path: mypath,
                    sameSite: true,
                    // @ts-expect-error
                    expires: 0, // session cookie only - expires/maxAge
                    secure: qSec,
                })

            // that.dumpExpressReqAppRes(req, res)

            next()
        }

        this.instanceRouters[node.url].use(masterMiddleware )

        // Track routes
        that.routers.instances[node.url].push( { name: 'uib Internal Middleware', path: `${that.uib.httpRoot}/${node.url}/`, desc: 'Master middleware, same for all instances', type: 'Handler', folder: '(internal)', } )
    }
(1b) Add uib's internal dynamic middleware - adds uibuilder specific headers & cookies
@param {uibNode} node Reference to the uibuilder node instance