[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"verticals":3,"article-nestjs-weekly-platform-node-adapter":44,"search-suggestions":504,"path-membership-nestjs-weekly-platform-node-adapter":546,"related-nestjs-weekly-platform-node-adapter":547,"code:ts:true:1d1jvbt":652,"code:ts:true:1kxll6c":653,"code:ts:true:1vlqr18":654,"code:ts:true:1oq97uu":655,"code:ts:true:31r6fb":656,"comments-01a1c5e4-28dd-73bd-882b-dee70aa37883":657},[4,20,32],{"id":5,"slug":6,"name":7,"tagline":8,"description":9,"accentFrom":10,"accentTo":11,"icon":12,"defaultLocale":13,"locales":14,"features":16,"position":19},"019fe637-3d33-714b-b57f-23e163ffca0c","dev","Web Development","Read it. Run it. Prove it.","A post a day on modern web development — most with an editable playground and a quiz that explains every answer. Free, no account needed.","violet-500","cyan-400","◇","en",[13,15],"fa",{"courses":17,"paths":17,"articles":17,"exams":18,"flashcards":18,"packages":17,"community":17,"certificates":17,"teams":17,"commerce":17},true,false,0,{"id":21,"slug":22,"name":23,"tagline":24,"description":25,"accentFrom":26,"accentTo":10,"icon":27,"defaultLocale":13,"locales":28,"features":30,"position":31},"019fe637-3dc2-754c-8657-0f175bfee7c6","lang","Languages","Learn a language the way you learn a codebase.","Grammar explained the way good documentation explains an API — one idea at a time, each with a quiz.","amber-400","⌘",[13,15,29],"es",{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":17,"packages":18,"community":17,"certificates":17,"teams":18,"commerce":18},2,{"id":33,"slug":34,"name":35,"tagline":36,"description":37,"accentFrom":38,"accentTo":39,"icon":40,"defaultLocale":13,"locales":41,"features":42,"position":43},"7b3c16f2-931d-410e-802e-e1fa4edab7de","soft","Soft Skills","The half of the job nobody wrote documentation for.","Weekly, on the parts of working life that decide more than your code does — first weeks, meetings, interviews, promotions, and the people around you. Written from what actually happens, and recorded as a podcast you can listen to on the walk.","emerald-400","teal-300","◉",[13],{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":18,"packages":18,"community":17,"certificates":18,"teams":18,"commerce":18},3,{"id":45,"slug":46,"title":47,"subtitle":48,"excerpt":49,"coverUrl":50,"locale":13,"readingMinutes":51,"publishedAt":52,"viewCount":53,"likeCount":19,"commentCount":19,"author":54,"vertical":59,"topic":60,"tags":63,"_count":74,"playground":76,"body":78,"bodyMd":436,"seo":437,"translationGroupId":439,"series":440,"podcastUrl":48,"verticalId":5,"thread":493,"assessments":495,"translations":500,"quiz":502},"01a1c5e4-28dd-73bd-882b-dee70aa37883","nestjs-weekly-platform-node-adapter","NestJS platform-node (12.3): The Adapter That Reorders Your Routes",null,"NestJS 12.3 shipped platform-node, a built-in HTTP adapter that matches routes like Fastify, not Express. Learn the trap, plus a cheat sheet.","\u002Fmedia\u002Fcovers\u002Fnestjs-weekly-platform-node-adapter.png",14,"2026-11-27T11:30:39.049Z",38,{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},"019fe637-3c25-7088-9034-39c9f15dc3c8","Parsa Jiravand","parsa","Frontend engineer · building bestpractic",{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},"nestjs","Nestjs",[64,65,68,71],{"slug":61,"name":62,"color":48},{"slug":66,"name":67,"color":48},"typescript","Typescript",{"slug":69,"name":70,"color":48},"node","Node",{"slug":72,"name":73,"color":48},"tutorial","Tutorial",{"assessments":75},1,{"slug":46,"title":77},"NestJS platform-node route matching — interactive playground",{"blocks":79,"version":75},[80,84,87,92,95,104,107,110,113,116,130,134,137,143,146,149,152,155,159,162,165,168,176,179,182,185,189,192,198,201,204,207,210,213,216,219,222,225,228,231,234,237,253,256,259,262,265,268,272,275,278,285,288,295,298,302,305,308,311,314,317,321,324,327,330,333,337,368,371,374,382,385,388,391,394,397,400,403,406,409,412,418,421,424,427,430],{"id":81,"html":82,"type":83},"b1","\u003Cp>A team upgrades \u003Ccode>@nestjs\u002Fcore\u003C\u002Fcode> and swaps \u003Ccode>NestFactory.create(AppModule)\u003C\u002Fcode> for \u003Ccode>NestFactory.create(AppModule, new NodeAdapter())\u003C\u002Fcode> — NestJS&#39;s brand-new, Express-free HTTP adapter, chasing the ~50% throughput bump its author measured against Express. Everything passes locally. In production, a request to \u003Ccode>\u002Fusers\u002FMe\u003C\u002Fcode> — a stray capital from an old mobile build nobody&#39;s shipped in a year — starts returning 404 instead of the profile it always returned. Nobody touched routing. Nobody touched that controller. The adapter just started enforcing something Express never did.\u003C\u002Fp>","paragraph",{"id":85,"html":86,"type":83},"b2","\u003Cp>This article is about \u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode>, the native HTTP adapter NestJS shipped in \u003Cstrong>12.3.0\u003C\u002Fstrong> (merged October 27, 2026, via \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fnestjs\u002Fnest\u002Fpull\u002F18063\">PR #18063\u003C\u002Fa>), and the two routing assumptions it changes versus Express — one of which Fastify users already live with today.\u003C\u002Fp>",{"id":88,"html":89,"text":90,"type":91,"level":31},"b3","What you&#39;ll learn","What you'll learn","heading",{"id":93,"html":94,"type":83},"b4","\u003Cp>By the end of this article you&#39;ll be able to:\u003C\u002Fp>",{"id":96,"type":97,"items":98,"ordered":18},"b5","list",[99,100,101,102,103],"Explain what Nest&#39;s \u003Ccode>HttpAdapter\u003C\u002Fcode> abstraction is, and why swapping it never touches your controllers, guards, pipes, or DI","State exactly how \u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode> decides which route matches a request, and how that differs from the Express adapter Nest uses by default","Recognize the case-sensitivity trap before it reaches production, and know whether it affects you at all if you&#39;re already on Fastify","Read \u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode>&#39;s own stated limitations honestly, instead of assuming 100% Express parity","Decide, today, whether adopting it now is worth it, ahead of it becoming the v13 default",{"id":105,"html":106,"text":106,"type":91,"level":31},"b6","Who this is for",{"id":108,"html":109,"type":83},"b7","\u003Cp>You&#39;ve built at least one NestJS app with the default Express adapter (\u003Ccode>@nestjs\u002Fplatform-express\u003C\u002Fcode>) and used \u003Ccode>@Controller()\u003C\u002Fcode>\u002F\u003Ccode>@Get()\u003C\u002Fcode>-style routing. You don&#39;t need any prior exposure to Fastify or to Nest&#39;s adapter internals — this article builds that model from scratch.\u003C\u002Fp>",{"id":111,"html":112,"type":83},"b8","\u003Cp>This is written against \u003Cstrong>NestJS 12.x\u003C\u002Fstrong>, verified against \u003Ccode>@nestjs\u002Fcore\u003C\u002Fcode>&#39;s npm dist-tags (\u003Ccode>latest\u003C\u002Fcode> is \u003Ccode>12.6.2\u003C\u002Fcode>; the 11.x line sits on the \u003Ccode>legacy\u003C\u002Fcode> tag at \u003Ccode>11.2.12\u003C\u002Fcode>). \u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode> itself landed in \u003Ccode>12.3.0\u003C\u002Fcode> and is also published up through \u003Ccode>12.6.2\u003C\u002Fcode> today. Per the adapter&#39;s own merged documentation PR, it&#39;s recommended as opt-in from 12.3 and becomes the \u003Cstrong>default adapter in v13\u003C\u002Fstrong> — so this is a change worth understanding before it&#39;s made for you.\u003C\u002Fp>",{"id":114,"html":115,"text":115,"type":91,"level":31},"b9","Table of contents",{"id":117,"type":97,"items":118,"ordered":18},"b10",[119,120,121,122,123,124,125,126,127,128,129],"\u003Ca href=\"#the-problem-an-adapter-swap-that-shouldnt-change-behavior\">The problem: an adapter swap that &quot;shouldn&#39;t&quot; change behavior\u003C\u002Fa>","\u003Ca href=\"#the-mental-model-the-adapter-sits-below-everything-nest-specific\">The mental model: the adapter sits below everything Nest-specific\u003C\u002Fa>","\u003Ca href=\"#stage-1-what-platform-node-actually-is\">Stage 1: what platform-node actually is\u003C\u002Fa>","\u003Ca href=\"#stage-2-switching-adapters\">Stage 2: switching adapters\u003C\u002Fa>","\u003Ca href=\"#stage-3-route-matching-specificity-not-declaration-order\">Stage 3: route matching — specificity, not declaration order\u003C\u002Fa>","\u003Ca href=\"#stage-4-the-case-sensitivity-trap\">Stage 4: the case-sensitivity trap\u003C\u002Fa>","\u003Ca href=\"#stage-5-what-still-behaves-like-express\">Stage 5: what still behaves like Express\u003C\u002Fa>","\u003Ca href=\"#edge-cases-and-gotchas\">Edge cases and gotchas\u003C\u002Fa>","\u003Ca href=\"#best-practices\">Best practices\u003C\u002Fa>","\u003Ca href=\"#faq\">FAQ\u003C\u002Fa>","\u003Ca href=\"#cheat-sheet\">Cheat sheet\u003C\u002Fa>",{"id":131,"html":132,"text":133,"type":91,"level":31},"b11","The problem: an adapter swap that &quot;shouldn&#39;t&quot; change behavior","The problem: an adapter swap that \"shouldn't\" change behavior",{"id":135,"html":136,"type":83},"b12","\u003Cp>Here&#39;s the controller from the scenario above, trimmed to the two routes that matter:\u003C\u002Fp>",{"id":138,"code":139,"type":140,"language":141,"highlight":142},"b13","\u002F\u002F users.controller.ts\n@Controller('users')\nexport class UsersController {\n  @Get(':id')\n  findOne(@Param('id') id: string) {\n    return this.usersService.findById(id);\n  }\n\n  @Get('me')\n  findMe(@CurrentUser() user: User) {\n    return user;\n  }\n}","code","ts",[],{"id":144,"html":145,"type":83},"b14","\u003Cp>Under the Express adapter — Nest&#39;s default — this already has a well-known trap: Express&#39;s router matches in \u003Cstrong>declaration order\u003C\u002Fstrong>, so a request to \u003Ccode>\u002Fusers\u002Fme\u003C\u002Fcode> would be swallowed by \u003Ccode>:id\u003C\u002Fcode> above it unless \u003Ccode>findMe\u003C\u002Fcode> is declared first. Assume this team already knows that rule and has \u003Ccode>findOne\u003C\u002Fcode> and \u003Ccode>findMe\u003C\u002Fcode> in a safe order. Their code is correct, their tests are green, and it stays that way after the upgrade.\u003C\u002Fp>",{"id":147,"html":148,"type":83},"b15","\u003Cp>What breaks isn&#39;t order — it&#39;s a second, unrelated default. \u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode> matches paths \u003Cstrong>case-sensitively\u003C\u002Fstrong>. Express, the adapter this app was built on, does not: by default it treats \u003Ccode>\u002FUsers\u002Fme\u003C\u002Fcode> and \u003Ccode>\u002Fusers\u002Fme\u003C\u002Fcode> as the same route. Nothing in the controller changed, nothing in the request changed except a capital letter an old client happened to send, and the behavior flipped anyway — because the thing underneath the controller changed.\u003C\u002Fp>",{"id":150,"html":151,"text":151,"type":91,"level":31},"b16","The mental model: the adapter sits below everything Nest-specific",{"id":153,"html":154,"type":83},"b17","\u003Cp>\u003Cstrong>The mental model:\u003C\u002Fstrong> Nest&#39;s container — dependency injection, modules, guards, interceptors, pipes, filters, and the \u003Ccode>@Controller()\u003C\u002Fcode>\u002F\u003Ccode>@Get()\u003C\u002Fcode> decorators that describe your routes — is \u003Cstrong>HTTP-engine-agnostic\u003C\u002Fstrong>. None of it knows whether a real HTTP server is Express, Fastify, or raw \u003Ccode>node:http\u003C\u002Fcode>. That knowledge lives entirely in one pluggable object: the \u003Ccode>HttpAdapter\u003C\u002Fcode>, passed as the second argument to \u003Ccode>NestFactory.create()\u003C\u002Fcode>.\u003C\u002Fp>",{"id":156,"code":157,"type":140,"language":141,"highlight":158},"b18","\u002F\u002F main.ts\nconst app = await NestFactory.create(AppModule); \u002F\u002F defaults to platform-express",[],{"id":160,"html":161,"type":83},"b19","\u003Cp>The adapter&#39;s job is narrow but foundational: take the route metadata Nest&#39;s container already discovered via reflection, and register it with whatever concrete HTTP engine it wraps — translating \u003Ccode>@Get(&#39;:id&#39;)\u003C\u002Fcode> into an Express route, a Fastify route, or now a \u003Ccode>platform-node\u003C\u002Fcode> route. Everything \u003Cem>above\u003C\u002Fem> that line — your services, your DI graph, your guards and pipes — never needs to know which adapter is underneath. That&#39;s also exactly why this bug is interesting: the adapter is the one place where swapping an implementation detail can change observable behavior, because routing and request\u002Fresponse shape are the adapter&#39;s actual responsibility, not the container&#39;s.\u003C\u002Fp>",{"id":163,"html":164,"text":164,"type":91,"level":31},"b20","Stage 1: what platform-node actually is",{"id":166,"html":167,"type":83},"b21","\u003Cp>\u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode> is a third \u003Ccode>HttpAdapter\u003C\u002Fcode>, alongside \u003Ccode>@nestjs\u002Fplatform-express\u003C\u002Fcode> and \u003Ccode>@nestjs\u002Fplatform-fastify\u003C\u002Fcode>. Unlike Fastify, it isn&#39;t a wrapper around an existing framework — it&#39;s built directly on Node&#39;s own \u003Ccode>node:http\u003C\u002Fcode>\u002F\u003Ccode>node:https\u003C\u002Fcode>, with no Express or Fastify dependency at all. Per its merged PR, it exists specifically so teams don&#39;t have to rewrite Express-style middleware and \u003Ccode>@Res()\u003C\u002Fcode> handlers the way adopting Fastify often requires. Concretely, it ships with:\u003C\u002Fp>",{"id":169,"type":97,"items":170,"ordered":18},"b22",[171,172,173,174,175],"\u003Cstrong>Routing\u003C\u002Fstrong> via a \u003Ccode>find-my-way\u003C\u002Fcode> radix-tree router — the same router Fastify uses — with \u003Ccode>path-to-regexp\u003C\u002Fcode> (Express&#39;s matcher) as a fallback for patterns \u003Ccode>find-my-way\u003C\u002Fcode> can&#39;t express.","\u003Cstrong>An Express-style middleware stack\u003C\u002Fstrong>, so \u003Ccode>app.use()\u003C\u002Fcode> middleware largely just works.","\u003Cstrong>Express-shaped response\u002Frequest helpers\u003C\u002Fstrong>: \u003Ccode>res.status()\u003C\u002Fcode>, \u003Ccode>.send()\u003C\u002Fcode>, \u003Ccode>.json()\u003C\u002Fcode>, \u003Ccode>.set()\u003C\u002Fcode>, \u003Ccode>.redirect()\u003C\u002Fcode>, \u003Ccode>.cookie()\u003C\u002Fcode>, \u003Ccode>.sendFile()\u003C\u002Fcode>, \u003Ccode>res.locals\u003C\u002Fcode>, \u003Ccode>req.get()\u003C\u002Fcode>, \u003Ccode>req.is()\u003C\u002Fcode>.","\u003Cstrong>Built-in body parsers\u003C\u002Fstrong> (JSON, URL-encoded, text, raw) accepting familiar \u003Ccode>body-parser\u003C\u002Fcode>-style options (\u003Ccode>limit\u003C\u002Fcode>, \u003Ccode>inflate\u003C\u002Fcode>, \u003Ccode>strict\u003C\u002Fcode>, \u003Ccode>verify\u003C\u002Fcode>, \u003Ccode>rawBody\u003C\u002Fcode>), with prototype-poisoning rejected by default.","\u003Cstrong>CORS, HTTPS, static assets, view engines, and multer-based file upload interceptors\u003C\u002Fstrong> — \u003Ccode>FileInterceptor\u003C\u002Fcode>, \u003Ccode>FilesInterceptor\u003C\u002Fcode>, \u003Ccode>FileFieldsInterceptor\u003C\u002Fcode>, and friends — carried over from \u003Ccode>platform-express\u003C\u002Fcode>.",{"id":177,"html":178,"type":83},"b23","\u003Cp>\u003Cstrong>Key concept:\u003C\u002Fstrong> platform-node isn&#39;t &quot;NestJS without a web framework&quot; — it&#39;s NestJS with a \u003Cem>minimal, purpose-built\u003C\u002Fem> one, designed to feel like the Express adapter you already know while routing like Fastify&#39;s.\u003C\u002Fp>",{"id":180,"html":181,"text":181,"type":91,"level":31},"b24","Stage 2: switching adapters",{"id":183,"html":184,"type":83},"b25","\u003Cp>The swap itself is a one-line change at the composition root — nowhere else:\u003C\u002Fp>",{"id":186,"code":187,"type":140,"language":141,"highlight":188},"b26","\u002F\u002F main.ts\nimport { NestFactory } from '@nestjs\u002Fcore';\nimport { NodeAdapter } from '@nestjs\u002Fplatform-node';\nimport { AppModule } from '.\u002Fapp.module';\n\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule, new NodeAdapter());\n  await app.listen(3000);\n}\nbootstrap();",[],{"id":190,"html":191,"type":83},"b27","\u003Cp>\u003Ccode>NodeAdapter\u003C\u002Fcode> takes a small set of opt-in options:\u003C\u002Fp>",{"id":193,"type":97,"items":194,"ordered":18},"b28",[195,196,197],"\u003Ccode>maxParamLength\u003C\u002Fcode> (default \u003Ccode>100\u003C\u002Fcode>) — a route parameter longer than this doesn&#39;t match that route; the request falls through to another match, or returns a 414.","\u003Ccode>trustProxy\u003C\u002Fcode> — reads \u003Ccode>req.ip\u003C\u002Fcode>, \u003Ccode>req.ips\u003C\u002Fcode>, \u003Ccode>req.protocol\u003C\u002Fcode>, \u003Ccode>req.secure\u003C\u002Fcode>, and \u003Ccode>req.hostname\u003C\u002Fcode> from \u003Ccode>X-Forwarded-*\u003C\u002Fcode> headers of trusted proxies. It accepts \u003Ccode>true\u003C\u002Fcode>, specific addresses\u002Fsubnets, or a function — and, like Fastify 5.12.1+, a bare numeric hop count trusts \u003Cstrong>no\u003C\u002Fstrong> proxy by itself.","\u003Ccode>querystringParser\u003C\u002Fcode> — replaces the default flat query-string parser (e.g. \u003Ccode>str =&gt; qs.parse(str)\u003C\u002Fcode> for nested query objects).",{"id":199,"html":200,"type":83},"b29","\u003Cp>Nothing else in the app changes. No controller, guard, pipe, or provider needs to know which adapter booted it.\u003C\u002Fp>",{"id":202,"html":203,"type":83},"b30","\u003C!-- playground:start -->",{"id":205,"html":206,"text":206,"type":91,"level":31},"b31","🎮 Try it yourself",{"id":208,"html":209,"type":83},"b32","\u003Cp>\u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-platform-node-adapter\u002Fplayground\">▶️ Open the interactive playground →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":211,"html":212,"type":83},"b33","\u003Cp>\u003Cem>Runs right in your browser — poke at it and watch the concept react live.\u003C\u002Fem>\u003C\u002Fp>",{"id":214,"html":215,"type":83},"b34","\u003C!-- playground:end -->",{"id":217,"html":218,"text":218,"type":91,"level":31},"b35","Stage 3: route matching — specificity, not declaration order",{"id":220,"html":221,"type":83},"b36","\u003Cp>This is the part that&#39;s easy to get backwards: \u003Cstrong>platform-node did not invent order-independent routing.\u003C\u002Fstrong> Fastify has worked this way for years, because it already routes through the same \u003Ccode>find-my-way\u003C\u002Fcode> radix tree. \u003Ccode>find-my-way\u003C\u002Fcode>&#39;s own documentation states its match order as a strict priority by node type — static segments first, then parametric-with-static-ending, then regex\u002Fmulti-parametric, then plain parametric, then wildcard — decided by the shape of the path, not the order routes were registered in.\u003C\u002Fp>",{"id":223,"html":224,"type":83},"b37","\u003Cp>Express works differently: its router (\u003Ccode>path-to-regexp\u003C\u002Fcode>-based) tries routes \u003Cstrong>in declaration order\u003C\u002Fstrong> and serves the first one that matches. That&#39;s precisely why &quot;declare \u003Ccode>\u002Fusers\u002Fme\u003C\u002Fcode> before \u003Ccode>\u002Fusers\u002F:id\u003C\u002Fcode>&quot; is standard Nest-with-Express advice — the advice exists \u003Cem>because\u003C\u002Fem> order is load-bearing there.\u003C\u002Fp>",{"id":226,"html":227,"type":83},"b38","\u003Cp>So the honest framing is: \u003Cstrong>if you&#39;re moving from Fastify to platform-node, route-matching behavior doesn&#39;t change\u003C\u002Fstrong> — both already pick the static \u003Ccode>\u002Fusers\u002Fme\u003C\u002Fcode> over the parametric \u003Ccode>\u002Fusers\u002F:id\u003C\u002Fcode> regardless of declaration order. \u003Cstrong>If you&#39;re moving from Express — Nest&#39;s default — this is new\u003C\u002Fstrong>, and it cuts both ways. Code that relied on careful ordering to shadow a dynamic route with a static one keeps working, now for a structural reason instead of a lucky one. But code that \u003Cem>depended\u003C\u002Fem> on declaration order to deliberately override a route — a pattern some teams use for staged rollouts or feature flags — can silently stop behaving the way it used to, because specificity, not position, now decides.\u003C\u002Fp>",{"id":229,"html":230,"text":230,"type":91,"level":31},"b39","Stage 4: the case-sensitivity trap",{"id":232,"html":233,"type":83},"b40","\u003Cp>This is the sharper, less-discussed change, and it&#39;s the one from the opening scenario. Per platform-node&#39;s own documented differences from Express, \u003Cstrong>paths match case-sensitively\u003C\u002Fstrong> — for routes, for middleware, and for \u003Ccode>exclude()\u003C\u002Fcode> patterns (e.g. \u003Ccode>MiddlewareConsumer.exclude()\u003C\u002Fcode>) alike.\u003C\u002Fp>",{"id":235,"html":236,"type":83},"b41","\u003Cp>Here&#39;s where each adapter actually stands:\u003C\u002Fp>",{"id":238,"head":239,"rows":242,"type":252},"b42",[240,241],"Adapter","Case-sensitive by default?",[243,246,249],[244,245],"Express (\u003Ccode>@nestjs\u002Fplatform-express\u003C\u002Fcode>, Nest&#39;s default)","\u003Cstrong>No\u003C\u002Fstrong> — \u003Ccode>\u002FUsers\u002Fme\u003C\u002Fcode> and \u003Ccode>\u002Fusers\u002Fme\u003C\u002Fcode> are the same route, unless you opt in",[247,248],"Fastify (\u003Ccode>@nestjs\u002Fplatform-fastify\u003C\u002Fcode>)","\u003Cstrong>Yes\u003C\u002Fstrong> — has been Fastify&#39;s documented default for years",[250,251],"\u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode>","\u003Cstrong>Yes\u003C\u002Fstrong> — matches Fastify&#39;s default, not Express&#39;s","table",{"id":254,"html":255,"type":83},"b43","\u003Cp>Express&#39;s own docs describe \u003Ccode>case sensitive routing\u003C\u002Fcode> as a disabled-by-default app setting — disabled meaning \u003Ccode>\u002FFoo\u003C\u002Fcode> and \u003Ccode>\u002Ffoo\u003C\u002Fcode> resolve to the same handler. Nest apps built on the default adapter inherit that leniency without anyone asking for it. Switch to platform-node, and any inbound path whose casing doesn&#39;t exactly match your route — a bookmarked URL, an old mobile build, a misconfigured upstream proxy — now gets a 404 instead of a 200.\u003C\u002Fp>",{"id":257,"html":258,"type":83},"b44","\u003Cp>\u003Cstrong>Key concept:\u003C\u002Fstrong> if your team is already on \u003Ccode>@nestjs\u002Fplatform-fastify\u003C\u002Fcode>, this entire section is a non-event — you&#39;ve been case-sensitive this whole time. If you&#39;re on the Express default, it&#39;s the one thing worth auditing \u003Cem>before\u003C\u002Fem> you flip the adapter, not after a support ticket tells you.\u003C\u002Fp>",{"id":260,"html":261,"type":83},"b45","\u003Cp>A pragmatic migration step: grep your routes, redirects, and any \u003Ccode>middleware.exclude()\u003C\u002Fcode> calls for inconsistent casing, and check your reverse proxy or CDN for anything that lowercases or rewrites incoming paths — a mismatch there now produces a silent 404 instead of a silently-tolerated typo.\u003C\u002Fp>",{"id":263,"html":264,"text":264,"type":91,"level":31},"b46","Stage 5: what still behaves like Express",{"id":266,"html":267,"type":83},"b47","\u003Cp>It&#39;s worth being equally clear about what \u003Cem>isn&#39;t\u003C\u002Fem> a trap. Because platform-node deliberately copies Express&#39;s middleware model and response helpers, most Express-shaped application code moves over unchanged:\u003C\u002Fp>",{"id":269,"code":270,"type":140,"language":141,"highlight":271},"b48","\u002F\u002F still works, unmodified, under platform-node\napp.use(cookieParser());\n\n@Get()\nfindAll(@Res() res: Response) {\n  res.status(200).json({ ok: true });\n}",[],{"id":273,"html":274,"type":83},"b49","\u003Cp>Body-parsing options, \u003Ccode>res.cookie()\u003C\u002Fcode>\u002F\u003Ccode>sendFile()\u003C\u002Fcode>\u002F\u003Ccode>locals\u003C\u002Fcode>, and \u003Ccode>req.is()\u003C\u002Fcode> all carry over. The adapter&#39;s own author is explicit that it does \u003Cstrong>not\u003C\u002Fstrong> aim for 100% Express API parity, though — strings returned from a handler are sent as \u003Ccode>text\u002Fplain\u003C\u002Fcode> (Express defaults to \u003Ccode>text\u002Fhtml\u003C\u002Fcode>), and \u003Ccode>res.set()\u003C\u002Fcode>\u002F\u003Ccode>res.type()\u003C\u002Fcode> don&#39;t append \u003Ccode>; charset=utf-8\u003C\u002Fcode> the way Express&#39;s do. Small, but worth a scan if you render raw strings or set content types manually.\u003C\u002Fp>",{"id":276,"html":277,"text":277,"type":91,"level":31},"b50","Edge cases and gotchas",{"id":279,"type":97,"items":280,"ordered":18},"b51",[281,282,283,284],"\u003Cstrong>Performance numbers are one author&#39;s benchmark, not a published standard.\u003C\u002Fstrong> The PR&#39;s own \u003Ccode>wrk\u003C\u002Fcode> results (M1 Pro, mixed GET\u002FPOST routes) show platform-node roughly 5% ahead of Fastify and about 50% ahead of Express — but the author notes 1–3% variance between quiet runs and 10%+ under background load, and at least one reviewer&#39;s own benchmark on a different setup showed a much larger gap that went unexplained. Treat it as &quot;competitive with Fastify, clearly ahead of Express,&quot; not as a precise multiplier, and benchmark your own workload before deciding on it.","\u003Cstrong>Route-conflict detection can misfire with host-filtered controllers.\u003C\u002Fstrong> Because \u003Ccode>isRouteOrderSensitive()\u003C\u002Fcode> reports \u003Ccode>false\u003C\u002Fcode> for platform-node, a route-conflict policy can reject what looks like a duplicate route when two controllers&#39; host patterns only partially overlap — a narrower gap the adapter&#39;s own tracking acknowledged at merge time.","\u003Cstrong>Package support was still catching up at merge.\u003C\u002Fstrong> \u003Ccode>@nestjs\u002Fserve-static\u003C\u002Fcode> and \u003Ccode>@nestjs\u002Fapollo\u003C\u002Fcode> didn&#39;t support the Node adapter on day one; both gained support shortly after. If you depend on either, confirm your installed version actually supports platform-node.","\u003Cstrong>Review-reported gaps were largely closed before merge, not after.\u003C\u002Fstrong> Early review passes on the PR surfaced issues with wildcard\u002Foptional-route middleware, \u003Ccode>@Render\u003C\u002Fcode> with \u003Ccode>hbs\u003C\u002Fcode>, and a few header-handling cases; the author&#39;s follow-up commits addressed most of them and folded the reviewer&#39;s test cases into the project&#39;s own integration suite. Still, if you lean on a less common feature (a custom view engine, an unusual middleware pattern), verify it directly against your installed version rather than assuming the PR description is the final word.",{"id":286,"html":287,"text":287,"type":91,"level":31},"b52","Best practices",{"id":289,"type":97,"items":290,"ordered":18},"b53",[291,292,293,294],"\u003Cstrong>Audit for case before you flip the adapter\u003C\u002Fstrong>, not after. If you&#39;re on Express today, this is the one change most likely to surface in production rather than in tests, because it depends on real client traffic, not your own code paths.","\u003Cstrong>Keep adapter-specific code behind \u003Ccode>HttpAdapterHost\u003C\u002Fcode>\u003C\u002Fstrong> where you can, instead of reaching for \u003Ccode>@Res()\u003C\u002Fcode> by default. Code that goes through Nest&#39;s response abstractions is less exposed to exactly this class of adapter-swap surprise.","\u003Cstrong>Don&#39;t assume Fastify-equivalence implies Express-equivalence.\u003C\u002Fstrong> Platform-node is modeled to feel like Express syntactically while behaving like Fastify structurally (routing, case sensitivity) — the two similarities aren&#39;t the same claim, and conflating them is how this bug ships.","\u003Cstrong>Treat adopting it today as an infrastructure decision, not a one-line diff\u003C\u002Fstrong>, even though the diff really is one line. It&#39;s opt-in as of 12.3 for a reason — becoming the v13 default gives the ecosystem (serve-static, Apollo, third-party packages) time to catch up first.",{"id":296,"html":297,"text":297,"type":91,"level":31},"b54","FAQ",{"id":299,"html":300,"text":301,"type":91,"level":43},"b55","Is \u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode> production-ready today?","Is @nestjs\u002Fplatform-node production-ready today?",{"id":303,"html":304,"type":83},"b56","\u003Cp>It&#39;s opt-in starting in NestJS 12.3, with its own documentation describing it as recommended to try now and planned as the \u003Cstrong>default\u003C\u002Fstrong> adapter in v13. That framing — &quot;try it, not yet the default&quot; — is the honest read on its current maturity; weigh the edge cases above against your own app&#39;s needs before treating it as a drop-in Express replacement.\u003C\u002Fp>",{"id":306,"html":307,"text":307,"type":91,"level":43},"b57","Is platform-node actually faster than Fastify?",{"id":309,"html":310,"type":83},"b58","\u003Cp>The adapter author&#39;s own benchmark shows it modestly ahead of Fastify and substantially ahead of Express, but that&#39;s one person&#39;s \u003Ccode>wrk\u003C\u002Fcode> run on one machine, with the author&#39;s own stated 1–3% run-to-run variance (more under load) and at least one reviewer reporting a larger, unexplained gap on a different setup. Treat the direction as credible and the exact percentage as unverified for your workload.\u003C\u002Fp>",{"id":312,"html":313,"text":313,"type":91,"level":43},"b59","Does switching adapters require touching my controllers, guards, or DI?",{"id":315,"html":316,"type":83},"b60","\u003Cp>No. Nest&#39;s container, dependency injection, module graph, guards, interceptors, pipes, and filters are all adapter-agnostic by design — the \u003Ccode>HttpAdapter\u003C\u002Fcode> is the one layer responsible for turning route metadata into an actual running server, which is exactly why this article&#39;s bug lives there and nowhere else.\u003C\u002Fp>",{"id":318,"html":319,"text":320,"type":91,"level":43},"b61","If I&#39;m already on Fastify, does any of this affect me?","If I'm already on Fastify, does any of this affect me?",{"id":322,"html":323,"type":83},"b62","\u003Cp>Mostly no. Fastify already routes by specificity via \u003Ccode>find-my-way\u003C\u002Fcode> and already matches paths case-sensitively by default, so both of platform-node&#39;s headline behavior changes are things you&#39;re already living with. What&#39;s new for a Fastify team is mainly the &quot;no separate framework underneath&quot; packaging, not a behavior shift.\u003C\u002Fp>",{"id":325,"html":326,"text":326,"type":91,"level":43},"b63","Can I run more than one adapter in the same app?",{"id":328,"html":329,"type":83},"b64","\u003Cp>No — exactly as with Express or Fastify today, a Nest application boots with a single \u003Ccode>HttpAdapter\u003C\u002Fcode>, passed once to \u003Ccode>NestFactory.create()\u003C\u002Fcode>.\u003C\u002Fp>",{"id":331,"html":332,"text":332,"type":91,"level":31},"b65","Cheat sheet",{"id":334,"code":335,"type":140,"language":141,"highlight":336},"b66","\u002F\u002F Switching to platform-node\nimport { NestFactory } from '@nestjs\u002Fcore';\nimport { NodeAdapter } from '@nestjs\u002Fplatform-node';\n\nconst app = await NestFactory.create(AppModule, new NodeAdapter({\n  maxParamLength: 100,      \u002F\u002F longer params don't match; 414 if nothing else does\n  trustProxy: false,        \u002F\u002F opt-in; numeric hop counts trust nothing by themselves\n  \u002F\u002F querystringParser: (s) => qs.parse(s), \u002F\u002F optional, replaces flat parsing\n}));",[],{"id":338,"head":339,"rows":344,"type":252},"b67",[340,341,342,343],"Behavior","Express (\u003Ccode>platform-express\u003C\u002Fcode>)","Fastify (\u003Ccode>platform-fastify\u003C\u002Fcode>)","\u003Ccode>platform-node\u003C\u002Fcode>",[345,349,353,358,363],[346,347,348,348],"Route matching","Declaration order (first match wins)","Specificity (\u003Ccode>find-my-way\u003C\u002Fcode> radix tree)",[350,351,352,352],"Case sensitivity","Insensitive by default","\u003Cstrong>Sensitive\u003C\u002Fstrong> by default",[354,355,356,357],"String response content-type","\u003Ccode>text\u002Fhtml; charset=utf-8\u003C\u002Fcode>","\u003Ccode>text\u002Fplain; charset=utf-8\u003C\u002Fcode>","\u003Ccode>text\u002Fplain\u003C\u002Fcode> (no charset)",[359,360,361,362],"Underlying engine","Express","Fastify","\u003Ccode>node:http\u003C\u002Fcode>\u002F\u003Ccode>node:https\u003C\u002Fcode> — no framework dependency",[364,365,366,367],"Status as of Nov 2026","Default adapter","Established alternative","Opt-in since 12.3; default in v13",{"id":369,"html":370,"type":83},"b68","\u003Cp>\u003Cstrong>Before flipping the adapter:\u003C\u002Fstrong> grep routes\u002Fmiddleware\u002F\u003Ccode>exclude()\u003C\u002Fcode> for assumed-safe mixed casing → confirm \u003Ccode>@nestjs\u002Fserve-static\u003C\u002Fcode>\u002F\u003Ccode>@nestjs\u002Fapollo\u003C\u002Fcode> versions support Node, if used → benchmark your own workload rather than trusting a single \u003Ccode>wrk\u003C\u002Fcode> run → keep adapter-specific escape hatches behind \u003Ccode>HttpAdapterHost\u003C\u002Fcode>.\u003C\u002Fp>",{"id":372,"html":373,"text":373,"type":91,"level":31},"b69","Key takeaways",{"id":375,"type":97,"items":376,"ordered":18},"b70",[377,378,379,380,381],"The \u003Ccode>HttpAdapter\u003C\u002Fcode> is the one layer in Nest that knows which HTTP engine is running underneath — everything else, including your entire DI graph, doesn&#39;t care.","\u003Ccode>@nestjs\u002Fplatform-node\u003C\u002Fcode> (NestJS 12.3+) routes by specificity via \u003Ccode>find-my-way\u003C\u002Fcode>, the same router Fastify already uses — this is new behavior if you&#39;re coming from Express, not new behavior at all if you&#39;re coming from Fastify.","It also matches paths case-sensitively, matching Fastify&#39;s long-standing default and breaking from Express&#39;s lenient one — audit for this before switching, not after a client sends an unexpected capital letter.","It&#39;s deliberately Express-shaped in its middleware and response API, but its own author says it doesn&#39;t aim for full parity — verify the handful of documented differences (content-type defaults, case sensitivity, no multi-adapter support) against your own app.","It&#39;s opt-in in 12.3 and becomes the default in v13 — the safest moment to learn its edges is now, while it&#39;s still a choice.",{"id":383,"html":384,"type":83},"b71","\u003C!-- quiz:start -->",{"id":386,"html":387,"text":387,"type":91,"level":31},"b72","🧠 Test yourself",{"id":389,"html":390,"type":83},"b73","\u003Cp>Think it clicked? \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-platform-node-adapter\u002Fquiz\">Take the 8-question quiz →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":392,"html":393,"type":83},"b74","\u003Cp>\u003Cem>Instant feedback, a hint on every question, and an explanation for each answer — right or wrong.\u003C\u002Fem>\u003C\u002Fp>",{"id":395,"html":396,"type":83},"b75","\u003C!-- quiz:end -->",{"id":398,"html":399,"text":399,"type":91,"level":31},"b76","Ending",{"id":401,"html":402,"type":83},"b77","\u003Cp>The team from the opening scenario fixed their 404 in one line — \u003Ccode>app.set(&#39;case sensitive routing&#39;, true)\u003C\u002Fcode> has no equivalent to undo on platform-node, so they normalized the stray capital at their CDN instead — but the real fix was reading platform-node&#39;s documented differences \u003Cem>before\u003C\u002Fem> the swap, not after a client complained. The adapter did exactly what it says it does. Nothing about it is a bug. It&#39;s just not Express underneath anymore, even though it still looks and acts like it on the surface.\u003C\u002Fp>",{"id":404,"html":405,"type":83},"b78","\u003Cp>If you&#39;re still on the Express default, what in your own routes is quietly depending on its case-insensitivity — and would you have noticed before a client did?\u003C\u002Fp>",{"id":407,"html":408,"type":83},"b79","\u003C!-- related:start -->",{"id":410,"html":411,"text":411,"type":91,"level":31},"b80","📚 Read next",{"id":413,"type":97,"items":414,"ordered":18},"b81",[415,416,417],"\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-standard-schema-validation\">NestJS 12: Standard Schema Validation Without class-validator\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-lifecycle-hook-order\">NestJS 12 Lifecycle Hooks: The Order You Can&#39;t Assume\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-validation-error-target\">NestJS 12.2: Why validationError.target Is Now undefined\u003C\u002Fa>",{"id":419,"html":420,"type":83},"b82","\u003C!-- related:end -->",{"id":422,"type":423},"b83","divider",{"id":425,"html":426,"type":83},"b84","\u003Cp>🚀 \u003Cstrong>Want more like this?\u003C\u002Fstrong> Every guide, playground, and quiz lives on \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">bestpractic.org\u003C\u002Fa>\u003C\u002Fstrong> — open it and \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">sign up free\u003C\u002Fa>\u003C\u002Fstrong> so the next one finds you.\u003C\u002Fp>",{"id":428,"html":429,"type":83},"b85","\u003Cp>\u003Cem>Thanks for reading! Let&#39;s stay connected:\u003C\u002Fem>\u003C\u002Fp>",{"id":431,"type":97,"items":432,"ordered":18},"b86",[433,434,435],"⭐ \u003Cstrong>GitHub\u003C\u002Fstrong> — follow me and star the projects: \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fparsajiravand\">github.com\u002Fparsajiravand\u003C\u002Fa>","💬 \u003Cstrong>Discord\u003C\u002Fstrong> — join the frontend best-practices community: \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ\">discord.gg\u002Fd9KRhuAwQ\u003C\u002Fa>","📸 \u003Cstrong>Instagram\u003C\u002Fstrong> — frontend best practices, daily: \u003Ca href=\"https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F\">@bestpractice___\u003C\u002Fa>","A team upgrades `@nestjs\u002Fcore` and swaps `NestFactory.create(AppModule)` for `NestFactory.create(AppModule, new NodeAdapter())` — NestJS's brand-new, Express-free HTTP adapter, chasing the ~50% throughput bump its author measured against Express. Everything passes locally. In production, a request to `\u002Fusers\u002FMe` — a stray capital from an old mobile build nobody's shipped in a year — starts returning 404 instead of the profile it always returned. Nobody touched routing. Nobody touched that controller. The adapter just started enforcing something Express never did.\n\nThis article is about `@nestjs\u002Fplatform-node`, the native HTTP adapter NestJS shipped in **12.3.0** (merged October 27, 2026, via [PR #18063](https:\u002F\u002Fgithub.com\u002Fnestjs\u002Fnest\u002Fpull\u002F18063)), and the two routing assumptions it changes versus Express — one of which Fastify users already live with today.\n\n## What you'll learn\n\nBy the end of this article you'll be able to:\n\n- Explain what Nest's `HttpAdapter` abstraction is, and why swapping it never touches your controllers, guards, pipes, or DI\n- State exactly how `@nestjs\u002Fplatform-node` decides which route matches a request, and how that differs from the Express adapter Nest uses by default\n- Recognize the case-sensitivity trap before it reaches production, and know whether it affects you at all if you're already on Fastify\n- Read `@nestjs\u002Fplatform-node`'s own stated limitations honestly, instead of assuming 100% Express parity\n- Decide, today, whether adopting it now is worth it, ahead of it becoming the v13 default\n\n## Who this is for\n\nYou've built at least one NestJS app with the default Express adapter (`@nestjs\u002Fplatform-express`) and used `@Controller()`\u002F`@Get()`-style routing. You don't need any prior exposure to Fastify or to Nest's adapter internals — this article builds that model from scratch.\n\nThis is written against **NestJS 12.x**, verified against `@nestjs\u002Fcore`'s npm dist-tags (`latest` is `12.6.2`; the 11.x line sits on the `legacy` tag at `11.2.12`). `@nestjs\u002Fplatform-node` itself landed in `12.3.0` and is also published up through `12.6.2` today. Per the adapter's own merged documentation PR, it's recommended as opt-in from 12.3 and becomes the **default adapter in v13** — so this is a change worth understanding before it's made for you.\n\n## Table of contents\n\n- [The problem: an adapter swap that \"shouldn't\" change behavior](#the-problem-an-adapter-swap-that-shouldnt-change-behavior)\n- [The mental model: the adapter sits below everything Nest-specific](#the-mental-model-the-adapter-sits-below-everything-nest-specific)\n- [Stage 1: what platform-node actually is](#stage-1-what-platform-node-actually-is)\n- [Stage 2: switching adapters](#stage-2-switching-adapters)\n- [Stage 3: route matching — specificity, not declaration order](#stage-3-route-matching-specificity-not-declaration-order)\n- [Stage 4: the case-sensitivity trap](#stage-4-the-case-sensitivity-trap)\n- [Stage 5: what still behaves like Express](#stage-5-what-still-behaves-like-express)\n- [Edge cases and gotchas](#edge-cases-and-gotchas)\n- [Best practices](#best-practices)\n- [FAQ](#faq)\n- [Cheat sheet](#cheat-sheet)\n\n## The problem: an adapter swap that \"shouldn't\" change behavior\n\nHere's the controller from the scenario above, trimmed to the two routes that matter:\n\n```ts\n\u002F\u002F users.controller.ts\n@Controller('users')\nexport class UsersController {\n  @Get(':id')\n  findOne(@Param('id') id: string) {\n    return this.usersService.findById(id);\n  }\n\n  @Get('me')\n  findMe(@CurrentUser() user: User) {\n    return user;\n  }\n}\n```\n\nUnder the Express adapter — Nest's default — this already has a well-known trap: Express's router matches in **declaration order**, so a request to `\u002Fusers\u002Fme` would be swallowed by `:id` above it unless `findMe` is declared first. Assume this team already knows that rule and has `findOne` and `findMe` in a safe order. Their code is correct, their tests are green, and it stays that way after the upgrade.\n\nWhat breaks isn't order — it's a second, unrelated default. `@nestjs\u002Fplatform-node` matches paths **case-sensitively**. Express, the adapter this app was built on, does not: by default it treats `\u002FUsers\u002Fme` and `\u002Fusers\u002Fme` as the same route. Nothing in the controller changed, nothing in the request changed except a capital letter an old client happened to send, and the behavior flipped anyway — because the thing underneath the controller changed.\n\n## The mental model: the adapter sits below everything Nest-specific\n\n**The mental model:** Nest's container — dependency injection, modules, guards, interceptors, pipes, filters, and the `@Controller()`\u002F`@Get()` decorators that describe your routes — is **HTTP-engine-agnostic**. None of it knows whether a real HTTP server is Express, Fastify, or raw `node:http`. That knowledge lives entirely in one pluggable object: the `HttpAdapter`, passed as the second argument to `NestFactory.create()`.\n\n```ts\n\u002F\u002F main.ts\nconst app = await NestFactory.create(AppModule); \u002F\u002F defaults to platform-express\n```\n\nThe adapter's job is narrow but foundational: take the route metadata Nest's container already discovered via reflection, and register it with whatever concrete HTTP engine it wraps — translating `@Get(':id')` into an Express route, a Fastify route, or now a `platform-node` route. Everything *above* that line — your services, your DI graph, your guards and pipes — never needs to know which adapter is underneath. That's also exactly why this bug is interesting: the adapter is the one place where swapping an implementation detail can change observable behavior, because routing and request\u002Fresponse shape are the adapter's actual responsibility, not the container's.\n\n## Stage 1: what platform-node actually is\n\n`@nestjs\u002Fplatform-node` is a third `HttpAdapter`, alongside `@nestjs\u002Fplatform-express` and `@nestjs\u002Fplatform-fastify`. Unlike Fastify, it isn't a wrapper around an existing framework — it's built directly on Node's own `node:http`\u002F`node:https`, with no Express or Fastify dependency at all. Per its merged PR, it exists specifically so teams don't have to rewrite Express-style middleware and `@Res()` handlers the way adopting Fastify often requires. Concretely, it ships with:\n\n- **Routing** via a `find-my-way` radix-tree router — the same router Fastify uses — with `path-to-regexp` (Express's matcher) as a fallback for patterns `find-my-way` can't express.\n- **An Express-style middleware stack**, so `app.use()` middleware largely just works.\n- **Express-shaped response\u002Frequest helpers**: `res.status()`, `.send()`, `.json()`, `.set()`, `.redirect()`, `.cookie()`, `.sendFile()`, `res.locals`, `req.get()`, `req.is()`.\n- **Built-in body parsers** (JSON, URL-encoded, text, raw) accepting familiar `body-parser`-style options (`limit`, `inflate`, `strict`, `verify`, `rawBody`), with prototype-poisoning rejected by default.\n- **CORS, HTTPS, static assets, view engines, and multer-based file upload interceptors** — `FileInterceptor`, `FilesInterceptor`, `FileFieldsInterceptor`, and friends — carried over from `platform-express`.\n\n**Key concept:** platform-node isn't \"NestJS without a web framework\" — it's NestJS with a *minimal, purpose-built* one, designed to feel like the Express adapter you already know while routing like Fastify's.\n\n## Stage 2: switching adapters\n\nThe swap itself is a one-line change at the composition root — nowhere else:\n\n```ts\n\u002F\u002F main.ts\nimport { NestFactory } from '@nestjs\u002Fcore';\nimport { NodeAdapter } from '@nestjs\u002Fplatform-node';\nimport { AppModule } from '.\u002Fapp.module';\n\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule, new NodeAdapter());\n  await app.listen(3000);\n}\nbootstrap();\n```\n\n`NodeAdapter` takes a small set of opt-in options:\n\n- `maxParamLength` (default `100`) — a route parameter longer than this doesn't match that route; the request falls through to another match, or returns a 414.\n- `trustProxy` — reads `req.ip`, `req.ips`, `req.protocol`, `req.secure`, and `req.hostname` from `X-Forwarded-*` headers of trusted proxies. It accepts `true`, specific addresses\u002Fsubnets, or a function — and, like Fastify 5.12.1+, a bare numeric hop count trusts **no** proxy by itself.\n- `querystringParser` — replaces the default flat query-string parser (e.g. `str => qs.parse(str)` for nested query objects).\n\nNothing else in the app changes. No controller, guard, pipe, or provider needs to know which adapter booted it.\n\n\u003C!-- playground:start -->\n\n## 🎮 Try it yourself\n\n**[▶️ Open the interactive playground →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-platform-node-adapter\u002Fplayground)**\n\n_Runs right in your browser — poke at it and watch the concept react live._\n\n\u003C!-- playground:end -->\n\n## Stage 3: route matching — specificity, not declaration order\n\nThis is the part that's easy to get backwards: **platform-node did not invent order-independent routing.** Fastify has worked this way for years, because it already routes through the same `find-my-way` radix tree. `find-my-way`'s own documentation states its match order as a strict priority by node type — static segments first, then parametric-with-static-ending, then regex\u002Fmulti-parametric, then plain parametric, then wildcard — decided by the shape of the path, not the order routes were registered in.\n\nExpress works differently: its router (`path-to-regexp`-based) tries routes **in declaration order** and serves the first one that matches. That's precisely why \"declare `\u002Fusers\u002Fme` before `\u002Fusers\u002F:id`\" is standard Nest-with-Express advice — the advice exists *because* order is load-bearing there.\n\nSo the honest framing is: **if you're moving from Fastify to platform-node, route-matching behavior doesn't change** — both already pick the static `\u002Fusers\u002Fme` over the parametric `\u002Fusers\u002F:id` regardless of declaration order. **If you're moving from Express — Nest's default — this is new**, and it cuts both ways. Code that relied on careful ordering to shadow a dynamic route with a static one keeps working, now for a structural reason instead of a lucky one. But code that *depended* on declaration order to deliberately override a route — a pattern some teams use for staged rollouts or feature flags — can silently stop behaving the way it used to, because specificity, not position, now decides.\n\n## Stage 4: the case-sensitivity trap\n\nThis is the sharper, less-discussed change, and it's the one from the opening scenario. Per platform-node's own documented differences from Express, **paths match case-sensitively** — for routes, for middleware, and for `exclude()` patterns (e.g. `MiddlewareConsumer.exclude()`) alike.\n\nHere's where each adapter actually stands:\n\n| Adapter | Case-sensitive by default? |\n| --- | --- |\n| Express (`@nestjs\u002Fplatform-express`, Nest's default) | **No** — `\u002FUsers\u002Fme` and `\u002Fusers\u002Fme` are the same route, unless you opt in |\n| Fastify (`@nestjs\u002Fplatform-fastify`) | **Yes** — has been Fastify's documented default for years |\n| `@nestjs\u002Fplatform-node` | **Yes** — matches Fastify's default, not Express's |\n\nExpress's own docs describe `case sensitive routing` as a disabled-by-default app setting — disabled meaning `\u002FFoo` and `\u002Ffoo` resolve to the same handler. Nest apps built on the default adapter inherit that leniency without anyone asking for it. Switch to platform-node, and any inbound path whose casing doesn't exactly match your route — a bookmarked URL, an old mobile build, a misconfigured upstream proxy — now gets a 404 instead of a 200.\n\n**Key concept:** if your team is already on `@nestjs\u002Fplatform-fastify`, this entire section is a non-event — you've been case-sensitive this whole time. If you're on the Express default, it's the one thing worth auditing *before* you flip the adapter, not after a support ticket tells you.\n\nA pragmatic migration step: grep your routes, redirects, and any `middleware.exclude()` calls for inconsistent casing, and check your reverse proxy or CDN for anything that lowercases or rewrites incoming paths — a mismatch there now produces a silent 404 instead of a silently-tolerated typo.\n\n## Stage 5: what still behaves like Express\n\nIt's worth being equally clear about what *isn't* a trap. Because platform-node deliberately copies Express's middleware model and response helpers, most Express-shaped application code moves over unchanged:\n\n```ts\n\u002F\u002F still works, unmodified, under platform-node\napp.use(cookieParser());\n\n@Get()\nfindAll(@Res() res: Response) {\n  res.status(200).json({ ok: true });\n}\n```\n\nBody-parsing options, `res.cookie()`\u002F`sendFile()`\u002F`locals`, and `req.is()` all carry over. The adapter's own author is explicit that it does **not** aim for 100% Express API parity, though — strings returned from a handler are sent as `text\u002Fplain` (Express defaults to `text\u002Fhtml`), and `res.set()`\u002F`res.type()` don't append `; charset=utf-8` the way Express's do. Small, but worth a scan if you render raw strings or set content types manually.\n\n## Edge cases and gotchas\n\n- **Performance numbers are one author's benchmark, not a published standard.** The PR's own `wrk` results (M1 Pro, mixed GET\u002FPOST routes) show platform-node roughly 5% ahead of Fastify and about 50% ahead of Express — but the author notes 1–3% variance between quiet runs and 10%+ under background load, and at least one reviewer's own benchmark on a different setup showed a much larger gap that went unexplained. Treat it as \"competitive with Fastify, clearly ahead of Express,\" not as a precise multiplier, and benchmark your own workload before deciding on it.\n- **Route-conflict detection can misfire with host-filtered controllers.** Because `isRouteOrderSensitive()` reports `false` for platform-node, a route-conflict policy can reject what looks like a duplicate route when two controllers' host patterns only partially overlap — a narrower gap the adapter's own tracking acknowledged at merge time.\n- **Package support was still catching up at merge.** `@nestjs\u002Fserve-static` and `@nestjs\u002Fapollo` didn't support the Node adapter on day one; both gained support shortly after. If you depend on either, confirm your installed version actually supports platform-node.\n- **Review-reported gaps were largely closed before merge, not after.** Early review passes on the PR surfaced issues with wildcard\u002Foptional-route middleware, `@Render` with `hbs`, and a few header-handling cases; the author's follow-up commits addressed most of them and folded the reviewer's test cases into the project's own integration suite. Still, if you lean on a less common feature (a custom view engine, an unusual middleware pattern), verify it directly against your installed version rather than assuming the PR description is the final word.\n\n## Best practices\n\n- **Audit for case before you flip the adapter**, not after. If you're on Express today, this is the one change most likely to surface in production rather than in tests, because it depends on real client traffic, not your own code paths.\n- **Keep adapter-specific code behind `HttpAdapterHost`** where you can, instead of reaching for `@Res()` by default. Code that goes through Nest's response abstractions is less exposed to exactly this class of adapter-swap surprise.\n- **Don't assume Fastify-equivalence implies Express-equivalence.** Platform-node is modeled to feel like Express syntactically while behaving like Fastify structurally (routing, case sensitivity) — the two similarities aren't the same claim, and conflating them is how this bug ships.\n- **Treat adopting it today as an infrastructure decision, not a one-line diff**, even though the diff really is one line. It's opt-in as of 12.3 for a reason — becoming the v13 default gives the ecosystem (serve-static, Apollo, third-party packages) time to catch up first.\n\n## FAQ\n\n### Is `@nestjs\u002Fplatform-node` production-ready today?\n\nIt's opt-in starting in NestJS 12.3, with its own documentation describing it as recommended to try now and planned as the **default** adapter in v13. That framing — \"try it, not yet the default\" — is the honest read on its current maturity; weigh the edge cases above against your own app's needs before treating it as a drop-in Express replacement.\n\n### Is platform-node actually faster than Fastify?\n\nThe adapter author's own benchmark shows it modestly ahead of Fastify and substantially ahead of Express, but that's one person's `wrk` run on one machine, with the author's own stated 1–3% run-to-run variance (more under load) and at least one reviewer reporting a larger, unexplained gap on a different setup. Treat the direction as credible and the exact percentage as unverified for your workload.\n\n### Does switching adapters require touching my controllers, guards, or DI?\n\nNo. Nest's container, dependency injection, module graph, guards, interceptors, pipes, and filters are all adapter-agnostic by design — the `HttpAdapter` is the one layer responsible for turning route metadata into an actual running server, which is exactly why this article's bug lives there and nowhere else.\n\n### If I'm already on Fastify, does any of this affect me?\n\nMostly no. Fastify already routes by specificity via `find-my-way` and already matches paths case-sensitively by default, so both of platform-node's headline behavior changes are things you're already living with. What's new for a Fastify team is mainly the \"no separate framework underneath\" packaging, not a behavior shift.\n\n### Can I run more than one adapter in the same app?\n\nNo — exactly as with Express or Fastify today, a Nest application boots with a single `HttpAdapter`, passed once to `NestFactory.create()`.\n\n## Cheat sheet\n\n```ts\n\u002F\u002F Switching to platform-node\nimport { NestFactory } from '@nestjs\u002Fcore';\nimport { NodeAdapter } from '@nestjs\u002Fplatform-node';\n\nconst app = await NestFactory.create(AppModule, new NodeAdapter({\n  maxParamLength: 100,      \u002F\u002F longer params don't match; 414 if nothing else does\n  trustProxy: false,        \u002F\u002F opt-in; numeric hop counts trust nothing by themselves\n  \u002F\u002F querystringParser: (s) => qs.parse(s), \u002F\u002F optional, replaces flat parsing\n}));\n```\n\n| Behavior | Express (`platform-express`) | Fastify (`platform-fastify`) | `platform-node` |\n| --- | --- | --- | --- |\n| Route matching | Declaration order (first match wins) | Specificity (`find-my-way` radix tree) | Specificity (`find-my-way` radix tree) |\n| Case sensitivity | Insensitive by default | **Sensitive** by default | **Sensitive** by default |\n| String response content-type | `text\u002Fhtml; charset=utf-8` | `text\u002Fplain; charset=utf-8` | `text\u002Fplain` (no charset) |\n| Underlying engine | Express | Fastify | `node:http`\u002F`node:https` — no framework dependency |\n| Status as of Nov 2026 | Default adapter | Established alternative | Opt-in since 12.3; default in v13 |\n\n**Before flipping the adapter:** grep routes\u002Fmiddleware\u002F`exclude()` for assumed-safe mixed casing → confirm `@nestjs\u002Fserve-static`\u002F`@nestjs\u002Fapollo` versions support Node, if used → benchmark your own workload rather than trusting a single `wrk` run → keep adapter-specific escape hatches behind `HttpAdapterHost`.\n\n## Key takeaways\n\n- The `HttpAdapter` is the one layer in Nest that knows which HTTP engine is running underneath — everything else, including your entire DI graph, doesn't care.\n- `@nestjs\u002Fplatform-node` (NestJS 12.3+) routes by specificity via `find-my-way`, the same router Fastify already uses — this is new behavior if you're coming from Express, not new behavior at all if you're coming from Fastify.\n- It also matches paths case-sensitively, matching Fastify's long-standing default and breaking from Express's lenient one — audit for this before switching, not after a client sends an unexpected capital letter.\n- It's deliberately Express-shaped in its middleware and response API, but its own author says it doesn't aim for full parity — verify the handful of documented differences (content-type defaults, case sensitivity, no multi-adapter support) against your own app.\n- It's opt-in in 12.3 and becomes the default in v13 — the safest moment to learn its edges is now, while it's still a choice.\n\n\n\u003C!-- quiz:start -->\n\n## 🧠 Test yourself\n\nThink it clicked? **[Take the 8-question quiz →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-platform-node-adapter\u002Fquiz)**\n\n_Instant feedback, a hint on every question, and an explanation for each answer — right or wrong._\n\n\u003C!-- quiz:end -->\n## Ending\n\nThe team from the opening scenario fixed their 404 in one line — `app.set('case sensitive routing', true)` has no equivalent to undo on platform-node, so they normalized the stray capital at their CDN instead — but the real fix was reading platform-node's documented differences *before* the swap, not after a client complained. The adapter did exactly what it says it does. Nothing about it is a bug. It's just not Express underneath anymore, even though it still looks and acts like it on the surface.\n\nIf you're still on the Express default, what in your own routes is quietly depending on its case-insensitivity — and would you have noticed before a client did?\n\n\u003C!-- related:start -->\n\n## 📚 Read next\n\n- [NestJS 12: Standard Schema Validation Without class-validator](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-standard-schema-validation)\n- [NestJS 12 Lifecycle Hooks: The Order You Can't Assume](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-lifecycle-hook-order)\n- [NestJS 12.2: Why validationError.target Is Now undefined](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-validation-error-target)\n\n\u003C!-- related:end -->\n\n---\n\n🚀 **Want more like this?** Every guide, playground, and quiz lives on **[bestpractic.org](https:\u002F\u002Fbestpractic.org\u002F)** — open it and **[sign up free](https:\u002F\u002Fbestpractic.org\u002F)** so the next one finds you.\n\n*Thanks for reading! Let's stay connected:*\n\n- ⭐ **GitHub** — follow me and star the projects: [github.com\u002Fparsajiravand](https:\u002F\u002Fgithub.com\u002Fparsajiravand)\n- 💬 **Discord** — join the frontend best-practices community: [discord.gg\u002Fd9KRhuAwQ](https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ)\n- 📸 **Instagram** — frontend best practices, daily: [@bestpractice___](https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F)",{"title":47,"canonical":438,"description":49},"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fnestjs-weekly-platform-node-adapter","01a1c5e4-28dd-73bd-882b-e0de42de448a",{"name":441,"part":442,"total":443,"items":444},"NestJS Deep Dive",11,12,[445,450,454,459,463,467,471,475,479,483,487,488],{"slug":446,"title":447,"publishedAt":448,"readingMinutes":449},"nestjs-weekly-request-lifecycle","NestJS Request Lifecycle Explained (with Cheat Sheet)","2026-08-28T17:01:41.941Z",13,{"slug":451,"title":452,"publishedAt":453,"readingMinutes":51},"nestjs-weekly-dependency-injection-providers-scopes","NestJS Dependency Injection Explained (with Cheat Sheet)","2026-09-13T08:40:18.434Z",{"slug":455,"title":456,"publishedAt":457,"readingMinutes":458},"nestjs-weekly-module-encapsulation-exports","NestJS Module Encapsulation Explained (with Cheat Sheet)","2026-09-13T08:40:50.070Z",15,{"slug":460,"title":461,"publishedAt":462,"readingMinutes":449},"nestjs-weekly-testing-provider-overrides","NestJS Testing Module: Provider Overrides (with Cheat Sheet)","2026-09-18T17:23:03.842Z",{"slug":464,"title":465,"publishedAt":466,"readingMinutes":51},"nestjs-weekly-guards-canactivate-reflector","NestJS Guards: CanActivate, ExecutionContext & Reflector","2026-09-26T12:25:39.001Z",{"slug":468,"title":469,"publishedAt":470,"readingMinutes":51},"nestjs-weekly-standard-schema-validation","NestJS 12: Standard Schema Validation Without class-validator","2026-10-02T06:11:02.679Z",{"slug":472,"title":473,"publishedAt":474,"readingMinutes":449},"nestjs-weekly-lifecycle-hook-order","NestJS 12 Lifecycle Hooks: The Order You Can't Assume","2026-10-23T06:10:32.276Z",{"slug":476,"title":477,"publishedAt":478,"readingMinutes":458},"nestjs-weekly-optional-not-inherited","NestJS 12: @Optional() Not Inherited by a Redeclared Constructor","2026-10-30T05:36:46.066Z",{"slug":480,"title":481,"publishedAt":482,"readingMinutes":443},"nestjs-weekly-validation-error-target","NestJS 12.2: Why validationError.target Is Now undefined","2026-11-06T06:10:24.442Z",{"slug":484,"title":485,"publishedAt":486,"readingMinutes":458},"nestjs-weekly-app-filter-scope","NestJS APP_FILTER Scope: Why Your Global Filter Might Not Fire","2026-11-21T06:53:12.171Z",{"slug":46,"title":47,"publishedAt":52,"readingMinutes":51},{"slug":489,"title":490,"publishedAt":491,"readingMinutes":492},"nestjs-weekly-interceptor-order","NestJS Interceptor Order: Why Stacking Breaks Your Cache","2026-11-27T11:44:57.150Z",16,{"id":494,"locked":18},"01a1c5e4-29eb-71be-9722-c87ded0275bd",[496],{"id":497,"slug":46,"title":47,"_count":498},"01a1c5e4-2a09-738d-952c-760679cf7633",{"questions":499},8,[501],{"locale":13,"slug":46},{"id":497,"slug":46,"title":47,"_count":503,"questionCount":499},{"questions":499},[505,509,513,517,519,523,525,529,533,537,539,543],{"slug":506,"name":507,"articles":508},"webdev","Webdev",195,{"slug":510,"name":511,"articles":512},"javascript","Javascript",156,{"slug":514,"name":515,"articles":516},"frontend","Frontend",103,{"slug":72,"name":73,"articles":518},85,{"slug":520,"name":521,"articles":522},"css","Css",56,{"slug":66,"name":67,"articles":524},36,{"slug":526,"name":527,"articles":528},"performance","Performance",33,{"slug":530,"name":531,"articles":532},"programming","Programming",26,{"slug":534,"name":535,"articles":536},"react","React",23,{"slug":69,"name":70,"articles":538},19,{"slug":540,"name":541,"articles":542},"browser","Browser",18,{"slug":544,"name":545,"articles":449},"nextjs","Nextjs",[],{"items":548,"meta":650},[549,563,575,590,605,620,635],{"id":550,"slug":489,"title":490,"subtitle":48,"excerpt":551,"coverUrl":552,"locale":13,"readingMinutes":492,"publishedAt":491,"viewCount":43,"likeCount":19,"commentCount":19,"author":553,"vertical":554,"topic":555,"tags":556,"_count":561,"playground":562,"hasQuiz":17,"hasPlayground":17},"01a1a1b0-49e9-711f-aea2-cbc2b73acc75","NestJS interceptor order decides whether a cache hit skips your response transform. Learn the onion model behind next.handle() — plus a copy-paste cheat sheet.","\u002Fmedia\u002Fcovers\u002Fnestjs-weekly-interceptor-order.png",{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},[557,558,559,560],{"slug":61,"name":62,"color":48},{"slug":69,"name":70,"color":48},{"slug":66,"name":67,"color":48},{"slug":72,"name":73,"color":48},{"assessments":75},{"slug":489},{"id":45,"slug":46,"title":47,"subtitle":48,"excerpt":49,"coverUrl":50,"locale":13,"readingMinutes":51,"publishedAt":52,"viewCount":564,"likeCount":19,"commentCount":19,"author":565,"vertical":566,"topic":567,"tags":568,"_count":573,"playground":574,"hasQuiz":17,"hasPlayground":17},39,{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},[569,570,571,572],{"slug":61,"name":62,"color":48},{"slug":66,"name":67,"color":48},{"slug":69,"name":70,"color":48},{"slug":72,"name":73,"color":48},{"assessments":75},{"slug":46},{"id":576,"slug":484,"title":485,"subtitle":48,"excerpt":577,"coverUrl":578,"locale":13,"readingMinutes":458,"publishedAt":486,"viewCount":579,"likeCount":19,"commentCount":19,"author":580,"vertical":581,"topic":582,"tags":583,"_count":588,"playground":589,"hasQuiz":17,"hasPlayground":17},"01a18121-99fa-77f0-83de-5cc8814cbbd4","A request-scoped APP_FILTER in NestJS can silently stop catching exceptions. Learn the fix NestJS 12 shipped, plus a copy-paste cheat sheet.","\u002Fmedia\u002Fcovers\u002Fnestjs-weekly-app-filter-scope.png",279,{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},[584,585,586,587],{"slug":61,"name":62,"color":48},{"slug":66,"name":67,"color":48},{"slug":69,"name":70,"color":48},{"slug":72,"name":73,"color":48},{"assessments":75},{"slug":484},{"id":591,"slug":480,"title":481,"subtitle":48,"excerpt":592,"coverUrl":593,"locale":13,"readingMinutes":443,"publishedAt":482,"viewCount":594,"likeCount":19,"commentCount":19,"author":595,"vertical":596,"topic":597,"tags":598,"_count":603,"playground":604,"hasQuiz":17,"hasPlayground":17},"01a15d15-305d-77da-a29a-d16a7df8ed3f","NestJS 12.2 defaults validationError.target to false, so a custom exceptionFactory reading error.target now gets undefined. The fix, plus a cheat sheet.","\u002Fmedia\u002Fcovers\u002Fnestjs-weekly-validation-error-target.png",351,{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},[599,600,601,602],{"slug":61,"name":62,"color":48},{"slug":66,"name":67,"color":48},{"slug":69,"name":70,"color":48},{"slug":72,"name":73,"color":48},{"assessments":75},{"slug":480},{"id":606,"slug":476,"title":477,"subtitle":48,"excerpt":607,"coverUrl":608,"locale":13,"readingMinutes":458,"publishedAt":478,"viewCount":609,"likeCount":19,"commentCount":19,"author":610,"vertical":611,"topic":612,"tags":613,"_count":618,"playground":619,"hasQuiz":17,"hasPlayground":17},"01a11150-cc6d-7657-8fe5-ae7578a8058b","NestJS 12 stops inheriting @Optional() once a subclass redeclares its own constructor — not when it has none at all. Cheat sheet included.","\u002Fmedia\u002Fcovers\u002Fnestjs-weekly-optional-not-inherited.png",437,{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},[614,615,616,617],{"slug":61,"name":62,"color":48},{"slug":66,"name":67,"color":48},{"slug":69,"name":70,"color":48},{"slug":72,"name":73,"color":48},{"assessments":75},{"slug":476},{"id":621,"slug":472,"title":473,"subtitle":48,"excerpt":622,"coverUrl":623,"locale":13,"readingMinutes":449,"publishedAt":474,"viewCount":624,"likeCount":19,"commentCount":19,"author":625,"vertical":626,"topic":627,"tags":628,"_count":633,"playground":634,"hasQuiz":17,"hasPlayground":17},"01a1358a-158e-70df-8178-64af7e9a5932","NestJS 12 changed how lifecycle hooks are ordered. Learn what onModuleInit and onApplicationBootstrap really guarantee, plus a copy-paste cheat sheet.","\u002Fmedia\u002Fcovers\u002Fnestjs-weekly-lifecycle-hook-order.png",468,{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},[629,630,631,632],{"slug":61,"name":62,"color":48},{"slug":66,"name":67,"color":48},{"slug":69,"name":70,"color":48},{"slug":72,"name":73,"color":48},{"assessments":75},{"slug":472},{"id":636,"slug":468,"title":469,"subtitle":48,"excerpt":637,"coverUrl":638,"locale":13,"readingMinutes":51,"publishedAt":470,"viewCount":639,"likeCount":19,"commentCount":19,"author":640,"vertical":641,"topic":642,"tags":643,"_count":648,"playground":649,"hasQuiz":17,"hasPlayground":17},"01a0f0ef-ccc8-73e8-9b53-e6ce4c7fe9ff","NestJS 12 adds Standard Schema validation for @Body(), @Query(), and @Param() — validate with Zod or Valibot, no class-validator DTO. Cheat sheet included.","\u002Fmedia\u002Fcovers\u002Fnestjs-weekly-standard-schema-validation.png",785,{"id":55,"name":56,"username":57,"avatarUrl":48,"headline":58},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":61,"name":62},[644,645,646,647],{"slug":61,"name":62,"color":48},{"slug":69,"name":70,"color":48},{"slug":66,"name":67,"color":48},{"slug":72,"name":73,"color":48},{"assessments":75},{"slug":468},{"page":75,"perPage":651,"total":443,"totalPages":31},7,"\u003Cdiv class=\"shj shj-lang-ts shj-multiline\" data-lang=\"ts\">\u003Cdiv class=\"shj-scroll\">\u003Cdiv class=\"shj-numbers\">\u003Cdiv>1\u003C\u002Fdiv>\u003Cdiv>2\u003C\u002Fdiv>\u003Cdiv>3\u003C\u002Fdiv>\u003Cdiv>4\u003C\u002Fdiv>\u003Cdiv>5\u003C\u002Fdiv>\u003Cdiv>6\u003C\u002Fdiv>\u003Cdiv>7\u003C\u002Fdiv>\u003Cdiv>8\u003C\u002Fdiv>\u003Cdiv>9\u003C\u002Fdiv>\u003Cdiv>10\u003C\u002Fdiv>\u003Cdiv>11\u003C\u002Fdiv>\u003Cdiv>12\u003C\u002Fdiv>\u003Cdiv>13\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cdiv class=\"shj-code\">\u003Cspan class=\"shj-cmnt\">\u002F\u002F users.controller.ts\n\u003C\u002Fspan>@\u003Cspan class=\"shj-class\">Controller\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-str\">'users'\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\n\u003Cspan class=\"shj-kwd\">export\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">class\u003C\u002Fspan> \u003Cspan class=\"shj-class\">UsersController\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n  @\u003Cspan class=\"shj-class\">Get\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-str\">':id'\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\n  \u003Cspan class=\"shj-func\">findOne\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>@\u003Cspan class=\"shj-class\">Param\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-str\">'id'\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan> id\u003Cspan class=\"shj-type\">: string\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n    \u003Cspan class=\"shj-kwd\">return\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">this\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>usersService\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">findById\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>id\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\n\n  @\u003Cspan class=\"shj-class\">Get\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-str\">'me'\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\n  \u003Cspan class=\"shj-func\">findMe\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>@\u003Cspan class=\"shj-class\">CurrentUser\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan> user\u003Cspan class=\"shj-oper\">:\u003C\u002Fspan> \u003Cspan class=\"shj-class\">User\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n    \u003Cspan class=\"shj-kwd\">return\u003C\u002Fspan> user;\n  \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\n\u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fdiv>","\u003Cdiv class=\"shj shj-lang-ts shj-multiline\" data-lang=\"ts\">\u003Cdiv class=\"shj-scroll\">\u003Cdiv class=\"shj-numbers\">\u003Cdiv>1\u003C\u002Fdiv>\u003Cdiv>2\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cdiv class=\"shj-code\">\u003Cspan class=\"shj-cmnt\">\u002F\u002F main.ts\n\u003C\u002Fspan>\u003Cspan class=\"shj-kwd\">const\u003C\u002Fspan> app \u003Cspan class=\"shj-oper\">=\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">await\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NestFactory\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">create\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-class\">AppModule\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>; \u003Cspan class=\"shj-cmnt\">\u002F\u002F defaults to platform-express\u003C\u002Fspan>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fdiv>","\u003Cdiv class=\"shj shj-lang-ts shj-multiline\" data-lang=\"ts\">\u003Cdiv class=\"shj-scroll\">\u003Cdiv class=\"shj-numbers\">\u003Cdiv>1\u003C\u002Fdiv>\u003Cdiv>2\u003C\u002Fdiv>\u003Cdiv>3\u003C\u002Fdiv>\u003Cdiv>4\u003C\u002Fdiv>\u003Cdiv>5\u003C\u002Fdiv>\u003Cdiv>6\u003C\u002Fdiv>\u003Cdiv>7\u003C\u002Fdiv>\u003Cdiv>8\u003C\u002Fdiv>\u003Cdiv>9\u003C\u002Fdiv>\u003Cdiv>10\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cdiv class=\"shj-code\">\u003Cspan class=\"shj-cmnt\">\u002F\u002F main.ts\n\u003C\u002Fspan>\u003Cspan class=\"shj-kwd\">import\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NestFactory\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">from\u003C\u002Fspan> \u003Cspan class=\"shj-str\">'@nestjs\u002Fcore'\u003C\u002Fspan>;\n\u003Cspan class=\"shj-kwd\">import\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NodeAdapter\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">from\u003C\u002Fspan> \u003Cspan class=\"shj-str\">'@nestjs\u002Fplatform-node'\u003C\u002Fspan>;\n\u003Cspan class=\"shj-kwd\">import\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan> \u003Cspan class=\"shj-class\">AppModule\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">from\u003C\u002Fspan> \u003Cspan class=\"shj-str\">'.\u002Fapp.module'\u003C\u002Fspan>;\n\n\u003Cspan class=\"shj-kwd\">async\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">function\u003C\u002Fspan> \u003Cspan class=\"shj-func\">bootstrap\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n  \u003Cspan class=\"shj-kwd\">const\u003C\u002Fspan> app \u003Cspan class=\"shj-oper\">=\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">await\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NestFactory\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">create\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-class\">AppModule\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">,\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">new\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NodeAdapter\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-kwd\">await\u003C\u002Fspan> app\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">listen\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-num\">3000\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n\u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\n\u003Cspan class=\"shj-func\">bootstrap\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fdiv>","\u003Cdiv class=\"shj shj-lang-ts shj-multiline\" data-lang=\"ts\">\u003Cdiv class=\"shj-scroll\">\u003Cdiv class=\"shj-numbers\">\u003Cdiv>1\u003C\u002Fdiv>\u003Cdiv>2\u003C\u002Fdiv>\u003Cdiv>3\u003C\u002Fdiv>\u003Cdiv>4\u003C\u002Fdiv>\u003Cdiv>5\u003C\u002Fdiv>\u003Cdiv>6\u003C\u002Fdiv>\u003Cdiv>7\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cdiv class=\"shj-code\">\u003Cspan class=\"shj-cmnt\">\u002F\u002F still works, unmodified, under platform-node\n\u003C\u002Fspan>app\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">use\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-func\">cookieParser\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n\n@\u003Cspan class=\"shj-class\">Get\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\n\u003Cspan class=\"shj-func\">findAll\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>@\u003Cspan class=\"shj-class\">Res\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan> res\u003Cspan class=\"shj-oper\">:\u003C\u002Fspan> \u003Cspan class=\"shj-class\">Response\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n  res\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">status\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-num\">200\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">json\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan> ok\u003Cspan class=\"shj-oper\">:\u003C\u002Fspan> \u003Cspan class=\"shj-bool\">true\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n\u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fdiv>","\u003Cdiv class=\"shj shj-lang-ts shj-multiline\" data-lang=\"ts\">\u003Cdiv class=\"shj-scroll\">\u003Cdiv class=\"shj-numbers\">\u003Cdiv>1\u003C\u002Fdiv>\u003Cdiv>2\u003C\u002Fdiv>\u003Cdiv>3\u003C\u002Fdiv>\u003Cdiv>4\u003C\u002Fdiv>\u003Cdiv>5\u003C\u002Fdiv>\u003Cdiv>6\u003C\u002Fdiv>\u003Cdiv>7\u003C\u002Fdiv>\u003Cdiv>8\u003C\u002Fdiv>\u003Cdiv>9\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cdiv class=\"shj-code\">\u003Cspan class=\"shj-cmnt\">\u002F\u002F Switching to platform-node\n\u003C\u002Fspan>\u003Cspan class=\"shj-kwd\">import\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NestFactory\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">from\u003C\u002Fspan> \u003Cspan class=\"shj-str\">'@nestjs\u002Fcore'\u003C\u002Fspan>;\n\u003Cspan class=\"shj-kwd\">import\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NodeAdapter\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">from\u003C\u002Fspan> \u003Cspan class=\"shj-str\">'@nestjs\u002Fplatform-node'\u003C\u002Fspan>;\n\n\u003Cspan class=\"shj-kwd\">const\u003C\u002Fspan> app \u003Cspan class=\"shj-oper\">=\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">await\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NestFactory\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">.\u003C\u002Fspan>\u003Cspan class=\"shj-func\">create\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-class\">AppModule\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">,\u003C\u002Fspan> \u003Cspan class=\"shj-kwd\">new\u003C\u002Fspan> \u003Cspan class=\"shj-class\">NodeAdapter\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n  maxParamLength\u003Cspan class=\"shj-oper\">:\u003C\u002Fspan> \u003Cspan class=\"shj-num\">100\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">,\u003C\u002Fspan>      \u003Cspan class=\"shj-cmnt\">\u002F\u002F longer params don't match; 414 if nothing else does\n\u003C\u002Fspan>  trustProxy\u003Cspan class=\"shj-oper\">:\u003C\u002Fspan> \u003Cspan class=\"shj-bool\">false\u003C\u002Fspan>\u003Cspan class=\"shj-oper\">,\u003C\u002Fspan>        \u003Cspan class=\"shj-cmnt\">\u002F\u002F opt-in; numeric hop counts trust nothing by themselves\n\u003C\u002Fspan>  \u003Cspan class=\"shj-cmnt\">\u002F\u002F querystringParser: (s) =&gt; qs.parse(s), \u002F\u002F optional, replaces flat parsing\n\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fdiv>",{"locked":18,"total":19,"comments":658},[]]