_register_middleware(pattern, middleware) {
        const record = {
            pattern: pattern.endsWith('/') ? pattern.slice(0, -1) : pattern, // Do not allow trailing slash in middlewares
            middleware,
        };

        // Store record for future subscribers
        this.#records.middlewares.push(record);

        // Create middleware if this is a Server extended Router instance (ROOT)
        if (this.#is_app) return this._create_middleware(record);

        // Alert all subscribers of the new middleware that was created
        this.#subscribers.forEach((subscriber) => subscriber('middleware', record));
    }
Registers a middleware from use() method and recalibrates.

@private
@param {String} pattern
@param {Function} middleware