Skip to content

Commit

Permalink
Support onHealthCheck as documented resolves apollographql#1449
Browse files Browse the repository at this point in the history
  • Loading branch information
garrypolley authored May 14, 2019
1 parent 7fb5a29 commit 6fb691c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/apollo-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ export class ApolloServer extends ApolloServerBase {
constructor(
config: ApolloServerExpressConfig & {
cors?: CorsOptions | boolean;
onHealthCheck?: (req: express.Request) => Promise<any>;
},
) {
super(config);
this.cors = config && config.cors;
this.onHealthCheck = config && config.onHealthCheck;
}

private createServerInfo(
Expand Down Expand Up @@ -90,6 +92,7 @@ export class ApolloServer extends ApolloServerBase {
app,
path: '/',
bodyParserConfig: { limit: '50mb' },
onHealthCheck: this.onHealthCheck,
cors:
typeof this.cors !== 'undefined'
? this.cors
Expand Down

0 comments on commit 6fb691c

Please sign in to comment.