@514labs/moose-lib 0.6.249-ci-4-gb1aae0fc → 0.6.249-ci-1-g07f4c473

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/index.mjs CHANGED
@@ -2513,7 +2513,19 @@ var WebApp = class {
2513
2513
  return app.callback();
2514
2514
  }
2515
2515
  if (typeof app.routing === "function") {
2516
- return (req, res) => {
2516
+ let isReady = false;
2517
+ let readyPromise = null;
2518
+ if (typeof app.ready === "function") {
2519
+ readyPromise = app.ready().then(() => {
2520
+ isReady = true;
2521
+ });
2522
+ } else {
2523
+ isReady = true;
2524
+ }
2525
+ return async (req, res) => {
2526
+ if (!isReady && readyPromise) {
2527
+ await readyPromise;
2528
+ }
2517
2529
  app.routing(req, res);
2518
2530
  };
2519
2531
  }