@514labs/moose-lib 0.6.245 → 0.6.246-ci-2-g0109f4ec

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
@@ -2507,16 +2507,9 @@ var WebApp = class {
2507
2507
  if (typeof app.callback === "function") {
2508
2508
  return app.callback();
2509
2509
  }
2510
- if (app.routing && typeof app.routing === "object") {
2511
- return async (req, res) => {
2512
- const fastifyApp = app;
2513
- if (fastifyApp.routing && typeof fastifyApp.routing.handle === "function") {
2514
- fastifyApp.routing.handle(req, res);
2515
- } else {
2516
- throw new Error(
2517
- "Fastify app detected but not properly initialized. Ensure .ready() is called before passing to WebApp."
2518
- );
2519
- }
2510
+ if (typeof app.routing === "function") {
2511
+ return (req, res) => {
2512
+ app.routing(req, res);
2520
2513
  };
2521
2514
  }
2522
2515
  throw new Error(
@@ -2524,11 +2517,12 @@ var WebApp = class {
2524
2517
  - A function (raw Node.js handler)
2525
2518
  - An object with .handle() method (Express, Connect)
2526
2519
  - An object with .callback() method (Koa)
2527
- - An object with .routing property (Fastify after .ready())
2520
+ - An object with .routing function (Fastify)
2528
2521
 
2529
2522
  Examples:
2530
2523
  Express: new WebApp("name", expressApp)
2531
2524
  Koa: new WebApp("name", koaApp)
2525
+ Fastify: new WebApp("name", fastifyApp)
2532
2526
  Raw: new WebApp("name", (req, res) => { ... })
2533
2527
  `
2534
2528
  );