tetherdb 0.1.0 → 0.1.1

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.
package/dist/cli/index.js CHANGED
@@ -1607,8 +1607,6 @@ var TetherServer = class {
1607
1607
  this._webSocketServer?.handleUpgrade(req, socket, head, (ws) => {
1608
1608
  this._webSocketServer?.emit("connection", ws, req);
1609
1609
  });
1610
- } else {
1611
- socket.destroy();
1612
1610
  }
1613
1611
  });
1614
1612
  }
@@ -1696,6 +1694,23 @@ var TetherServer = class {
1696
1694
  }
1697
1695
  });
1698
1696
  }
1697
+ /**
1698
+ * Creates a Connect- and Express-compatible HTTP middleware handler.
1699
+ *
1700
+ * @returns Middleware function `(req, res, next) => void`.
1701
+ */
1702
+ createMiddleware() {
1703
+ return (req, res, next) => {
1704
+ this.handleHttpRequest(req, res).then(
1705
+ (handled) => {
1706
+ if (!handled) next();
1707
+ },
1708
+ (err) => {
1709
+ next(err);
1710
+ }
1711
+ );
1712
+ };
1713
+ }
1699
1714
  /**
1700
1715
  * Handles incoming HTTP requests for authentication and discovery endpoints.
1701
1716
  *