Skip to content

Commit

Permalink
update available server types.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm committed Feb 26, 2024
1 parent 205dde6 commit b82ff70
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/resources/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ import { SERVICE_BIND } from '../constants';
import * as grpc from '@grpc/grpc-js';
import { ClientMessage, HttpProxyRequest } from '@nitric/proto/http/v1/http_pb';
import { Server } from 'http';
import { Http2SecureServer, Http2Server } from 'http2';

type ServerType = Server | Http2Server | Http2SecureServer;

type ListenerFunction =
| ((port: number, callback?: () => void) => Server | Promise<Server>)
| ((port: number) => Server | Promise<Server>);
| ((port: number, callback?: () => void) => ServerType | Promise<ServerType>)
| ((port: number) => ServerType | Promise<ServerType>);

interface NodeApplication {
listen: ListenerFunction;
Expand Down

0 comments on commit b82ff70

Please sign in to comment.