@trayio/express 4.52.0 → 4.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressHttpServer.d.ts","sourceRoot":"","sources":["../../src/http/ExpressHttpServer.ts"],"names":[],"mappings":";AAEA,OAAO,IAAI,GAAG,QAAQ,MAAM,CAAC,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,UAAU,oBAAoB;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,WAAW,gBACV,qBAAqB,EAAE,WAC3B,oBAAoB,yEAkC7B,CAAC"}
1
+ {"version":3,"file":"ExpressHttpServer.d.ts","sourceRoot":"","sources":["../../src/http/ExpressHttpServer.ts"],"names":[],"mappings":";AAEA,OAAO,IAAI,GAAG,QAAQ,MAAM,CAAC,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,UAAU,oBAAoB;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,WAAW,gBACV,qBAAqB,EAAE,WAC3B,oBAAoB,yEAoD7B,CAAC"}
@@ -20,8 +20,21 @@ const startServer = (controllers, options) => {
20
20
  type: (req) => skipBodyParserForMultipartFormData(req),
21
21
  }));
22
22
  app.use('/', newRouter);
23
- return app.listen(port, () => {
23
+ const server = app.listen(port, () => {
24
24
  console.log(`Web server listening on port ${port}`);
25
25
  });
26
+ process.on('SIGTERM', () => {
27
+ console.log('Received kill signal, shutting down gracefully...');
28
+ server.close(() => {
29
+ console.log('Closed out remaining connections.');
30
+ process.exit(0);
31
+ });
32
+ // If after 10 seconds, forcefully shut down
33
+ setTimeout(() => {
34
+ console.error('Could not close connections in time, forcefully shutting down');
35
+ process.exit(1);
36
+ }, 10000);
37
+ });
38
+ return server;
26
39
  };
27
40
  exports.startServer = startServer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/express",
3
- "version": "4.52.0",
3
+ "version": "4.53.0",
4
4
  "description": "Express extensions and implementations",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
@@ -14,7 +14,7 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@trayio/commons": "4.52.0",
17
+ "@trayio/commons": "4.53.0",
18
18
  "cors": "2.8.5",
19
19
  "express": "4.20.0",
20
20
  "formidable": "3.5.1"