_create_middleware(record) {
        // Destructure record from Router
        const { pattern, middleware } = record;

        // Do not allow route creation once it is locked after a not found handler has been bound
        if (this.#routes_locked === true)
            throw new Error(
                `HyperExpress: Routes/Routers must not be created or used after the Server.listen() has been called. [${method.toUpperCase()} ${pattern}]`
            );

        // Initialize middlewares array for specified pattern
        if (this.#middlewares[pattern] == undefined) this.#middlewares[pattern] = [];

        // Create a middleware object with an appropriate priority
        const object = {
            id: this._get_incremented_id(),
            pattern,
            handler: middleware,
        };

        // Store middleware object in its pattern branch
        this.#middlewares[pattern].push(object);
    }
Binds middleware to server instance and distributes over all created routes.

@private
@param {Object} record