Interface ExpressBrickOptionsNamespace

Interface for the options of ExpressBrick. It extends from BrickOptions and adds properties specific to ExpressBrick.

Hierarchy

Properties

builtinMiddleware?: {
    json: boolean;
    urlencoded: boolean;
}

An object specifying whether to use built-in middleware functions.

Type declaration

  • json: boolean

    Whether to use the built-in JSON middleware.

  • urlencoded: boolean

    Whether to use the built-in URL-encoded middleware.

database?: Database

The database of the Brick instance. This is used to manage the data storage and retrieval for the Brick.

host?: string

The host on which the Express server will listen.

id?: string

The unique identifier of the Brick instance. If not provided, a random UUID will be generated.

intelligence?: Intelligence

The Intelligence of the Brick instance. This is used to manage the AI capabilities of the Brick.

logJSON?: boolean

A boolean indicating whether the logs should be in JSON format.

logLevel?: Level

The log level of the Brick instance. This determines the level of detail of the logs.

middleware?: RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>[]

An array of middleware functions to use in the Express application.

name?: string

The name of the Brick instance. If not provided, the id will be used as the name.

pinoOptions?: LoggerOptions

The options for the pino logger used by the Brick instance.

port?: number

The port on which the Express server will listen.

routes?: {
    handler: ((req, res) => void);
    method: string;
    path: string;
}[]

An array of routes that the Express server will handle.

Type declaration

  • handler: ((req, res) => void)
      • (req, res): void
      • The handler function to execute when the route is hit.

        Parameters

        • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
        • res: Response<any, Record<string, any>>

        Returns void

  • method: string

    The HTTP method for the route.

  • path: string

    The path for the route.

structure?: Structure

The parent Structure of the Brick, if any.