@514labs/moose-lib 0.6.244-ci-1-g1f019cce → 0.6.244-ci-4-g8bb466b6
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/{browserCompatible-CwNwv0e0.d.mts → browserCompatible-bG7qUssc.d.mts} +1 -1
- package/dist/{browserCompatible-2eoeppzc.d.ts → browserCompatible-mRmtV1to.d.ts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +11 -5
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +11 -5
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/dmv2/index.d.mts +1 -1
- package/dist/dmv2/index.d.ts +1 -1
- package/dist/dmv2/index.js +11 -5
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +11 -5
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-bZEbqrMe.d.mts → index-DtHRzX8Z.d.mts} +1 -1
- package/dist/{index-bZEbqrMe.d.ts → index-DtHRzX8Z.d.ts} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2507,9 +2507,16 @@ var WebApp = class {
|
|
|
2507
2507
|
if (typeof app.callback === "function") {
|
|
2508
2508
|
return app.callback();
|
|
2509
2509
|
}
|
|
2510
|
-
if (typeof app.routing === "
|
|
2511
|
-
return (req, res) => {
|
|
2512
|
-
app
|
|
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
|
+
}
|
|
2513
2520
|
};
|
|
2514
2521
|
}
|
|
2515
2522
|
throw new Error(
|
|
@@ -2517,12 +2524,11 @@ var WebApp = class {
|
|
|
2517
2524
|
- A function (raw Node.js handler)
|
|
2518
2525
|
- An object with .handle() method (Express, Connect)
|
|
2519
2526
|
- An object with .callback() method (Koa)
|
|
2520
|
-
- An object with .routing
|
|
2527
|
+
- An object with .routing property (Fastify after .ready())
|
|
2521
2528
|
|
|
2522
2529
|
Examples:
|
|
2523
2530
|
Express: new WebApp("name", expressApp)
|
|
2524
2531
|
Koa: new WebApp("name", koaApp)
|
|
2525
|
-
Fastify: new WebApp("name", fastifyApp)
|
|
2526
2532
|
Raw: new WebApp("name", (req, res) => { ... })
|
|
2527
2533
|
`
|
|
2528
2534
|
);
|