Skip to content

Commit

Permalink
feat(cli): add default option for gracePeriodForClose to configure ht…
Browse files Browse the repository at this point in the history
…tp/https close
  • Loading branch information
raymondfeng committed Nov 28, 2019
1 parent c5fc495 commit 5a243e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/cli/generators/app/templates/index.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ if (require.main === module) {
rest: {
port: +(process.env.PORT || 3000),
host: process.env.HOST,
// The `gracePeriodForClose` provides a graceful close for http/https
// servers with keep-alive clients. The default value is `Infinity`
// (don't force-close). If you want to immediately destroy all sockets
// upon stop, set its value to `0`.
// See https://www.npmjs.com/package/stoppable
gracePeriodForClose: 5000, // 5 seconds
openApiSpec: {
// useful when used with OpenAPI-to-GraphQL to locate your application
setServersFromRequest: true,
Expand Down

0 comments on commit 5a243e2

Please sign in to comment.