Skip to content
Discussion options

You must be logged in to vote

Sure thing @vansergen -
I have a class constructor setting up

   this.app = app !== undefined ? app : express();

and a start method

 public start(
    portOrListenOptions: number | ListenOptions,
    serverOptions: ServerOptions | HTTPSServerOptions = {},
  ): Promise<Server | HTTPSServer> {
    let createServerFn: typeof createServer | typeof createHttpsServer = createServer;

    // Look for HTTPS-specific serverOptions to determine which factory function to use
    if (Object.keys(serverOptions).filter((k) => httpsOptionKeys.includes(k)).length > 0) {
      createServerFn = createHttpsServer;
    }

    if (this.server !== undefined) {
      return Promise.reject(
        new Receiver…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@srajiang
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@vansergen
Comment options

Answer selected by srajiang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pkg: node Discussions related to node
4 participants