Skip to content

Setting the Request Timeout seconds globally. #2308

Closed Answered by Romakita
sota-k asked this question in Q&A
Discussion options

You must be logged in to vote
import Http from "http";
import Https from "https";
import {Inject} from "@tsed/di";

@Configuration({})
class Server {
  @Inject(Http.Server)
  protected httpServer: Http.Server | null;

  @Inject(Https.Server)
  protected httpsServer: Https.Server | null;
  
  $onInit() {
    if (this.httpServer) {
      this.httpServer.timeout = 3000
    }
    if (this.httpsServer) {
      this.httpsServer.timeout = 3000
    }
  }
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sota-k
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants