ITADN

Is there a recommended approach for working with Fetch API (Request, Response) instead of Node API (IncomingMessage, ServerResponse)?

#2373Closedtresorama 创建于 2026-01-11
T
tresoramacommented
> DISCLAIMER: if this issue is better suited to `pino-http` tell me and i will re-open issue there ## Background As we know, Node way of handling HTTP request is with (`node:http`) ``` Request -> http.IncomingMessage Response -> http.ServerResponse ``` ...but since last few years, we can also use Fetch API (`fetch`) ``` Request -> Request Response -> Response ``` Here is a simplified table that compare API usage in common Node web framework. | Framework Name | API Name | |----------------------|-------------| | Node (native) | node:http | | Express | node:http | | Fastify | node:http | | Koa | node:http | | Hono | fetch | | Next.js (Pages Router) | node:http | | Next.js (App Router) | fetch | | SolidStart | fetch | | SvelteKit | fetch | | Nuxt (Nitro / H3) | fetch | | TanStack Start | fetch | | Remix v2 | fetch | ## Question pino (pino-http) is made for `node:http`. Do we have a recommended approach for auto-loggin HTTP request in Fetch API?
关闭于 2026-01-11 1 条评论