Where to find implementation of bodyParser middleware for next js api route

Hi trying to manually import the next js bodyParser middleware but cant find it's implementation in the next github repo, anybody know where I can find it ty : D (Doing it to create a middleware for a trpc openapi router so can have the raw body for some endpoints and the parsed body for others)
2 Replies
JulieCezar
JulieCezar15mo ago
I don't know if it helps or if it's true, but I found a library called parse-json which I think NextJS uses under the hood to parse requests. You can find it in node_modules or check out /node_modules/next/dist/server/api-utils/node.js
ja_iy
ja_iy15mo ago
GitHub
next.js/node.ts at canary · vercel/next.js
The React Framework. Contribute to vercel/next.js development by creating an account on GitHub.