use

abstract fun use(handler: Value)

Register a global middleware handler. The handler must be a function and will receive an ExpressRequest, an ExpressResponse, and a callable next value, which can be used to call the next handler in the pipeline.


abstract fun use(path: String, handler: Value)

Register a middleware handler at path. The handler must be a function and will receive an ExpressRequest, an ExpressResponse, and a callable next value, which can be used to call the next handler in the pipeline.