如何在 LB4 中设置超时?

How can I set timeout in LB4?

我正在使用 LoopBack 4(LB4)。 对 API 的访问在 120 秒后断开。 我希望超时大于 120 秒。

我将 LB4 与 AWS Elastic Beanstalk Worker 结合使用。 我想更改处理时间超过 120 秒的超时值。

使用 http-server-default-timeout 选项时可以更改超时值。 https://nodejs.org/docs/latest-v12.x/api/cli.html#cli_http_server_default_timeout_milliseconds

但是,以上选项只能在nodejs上使用12.x。

我想知道如何在 Nodejs 中更改 server.timeout 10.x

export class TestController {
    constructor(
        @inject(RestBindings.Http.RESPONSE) private response: Response
    ) {
        (this.response as any).setTimeout(1000);
    }
}

这有效。