Skip to content

Commit bd5e473

Browse files
committed
Fix Fastify platform detection for NestJS
1 parent e3943d1 commit bd5e473

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/nestjs/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ export async function useApitally(
2323
) {
2424
const httpAdapter = app.getHttpAdapter();
2525
const instance = httpAdapter.getInstance();
26-
const platform =
27-
instance.use === undefined && typeof instance.register === "function"
28-
? "fastify"
29-
: "express";
26+
const platform = httpAdapter.constructor.name
27+
.toLowerCase()
28+
.includes("fastify")
29+
? "fastify"
30+
: "express";
3031

3132
if (platform === "express") {
3233
const { useApitally, setConsumer } = await import("../express/index.js");

0 commit comments

Comments
 (0)