[{"data":1,"prerenderedAt":1533},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fpackages\u002Fuws-server":184,"\u002Fdocs\u002Fpackages\u002Fuws-server-surround":1528},[4,21,90,166],{"title":5,"path":6,"stem":7,"children":8,"status":11,"icon":20},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,12,16],{"title":10,"path":6,"stem":7,"status":11},"Introduction",null,{"title":13,"path":14,"stem":15,"status":11},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","1.docs\u002F1.getting-started\u002F2.installation",{"title":17,"path":18,"stem":19,"status":11},"Quick Start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","1.docs\u002F1.getting-started\u002F3.quick-start",false,{"title":22,"path":23,"stem":24,"children":25,"status":11,"icon":20},"Core Concepts","\u002Fdocs\u002Fcore-concepts","1.docs\u002F2.core-concepts\u002F1.index",[26,28,32,36,40,50,54,58,62,66,70,74,78,82,86],{"title":27,"path":23,"stem":24,"status":11},"Overview",{"title":29,"path":30,"stem":31,"status":11},"Response","\u002Fdocs\u002Fcore-concepts\u002Fresponse","1.docs\u002F2.core-concepts\u002F10.response",{"title":33,"path":34,"stem":35,"status":11},"Cookies","\u002Fdocs\u002Fcore-concepts\u002Fcookies","1.docs\u002F2.core-concepts\u002F11.cookies",{"title":37,"path":38,"stem":39,"status":11},"Testing","\u002Fdocs\u002Fcore-concepts\u002Ftesting","1.docs\u002F2.core-concepts\u002F12.testing",{"title":41,"path":42,"stem":43,"children":44,"status":11,"icon":20,"defaultOpen":20},"Decorators","\u002Fdocs\u002Fcore-concepts\u002Fdecorators","1.docs\u002F2.core-concepts\u002F13.decorators\u002F1.index",[45,46],{"title":27,"path":42,"stem":43,"status":11},{"title":47,"path":48,"stem":49,"status":11},"Custom","\u002Fdocs\u002Fcore-concepts\u002Fdecorators\u002Fcustom","1.docs\u002F2.core-concepts\u002F13.decorators\u002F2.custom",{"title":51,"path":52,"stem":53,"status":11},"Discovery Service","\u002Fdocs\u002Fcore-concepts\u002Fdiscovery","1.docs\u002F2.core-concepts\u002F14.discovery",{"title":55,"path":56,"stem":57,"status":11},"Application Lifecycle","\u002Fdocs\u002Fcore-concepts\u002Fapp-lifecycle","1.docs\u002F2.core-concepts\u002F15.app-lifecycle",{"title":59,"path":60,"stem":61,"status":11},"Controllers","\u002Fdocs\u002Fcore-concepts\u002Fcontrollers","1.docs\u002F2.core-concepts\u002F2.controllers",{"title":63,"path":64,"stem":65,"status":11},"Routing","\u002Fdocs\u002Fcore-concepts\u002Frouting","1.docs\u002F2.core-concepts\u002F3.routing",{"title":67,"path":68,"stem":69,"status":11},"Providers","\u002Fdocs\u002Fcore-concepts\u002Fproviders","1.docs\u002F2.core-concepts\u002F4.providers",{"title":71,"path":72,"stem":73,"status":11},"Modules","\u002Fdocs\u002Fcore-concepts\u002Fmodules","1.docs\u002F2.core-concepts\u002F5.modules",{"title":75,"path":76,"stem":77,"status":11},"Configuration","\u002Fdocs\u002Fcore-concepts\u002Fconfiguration","1.docs\u002F2.core-concepts\u002F6.configuration",{"title":79,"path":80,"stem":81,"status":11},"Middleware","\u002Fdocs\u002Fcore-concepts\u002Fmiddleware","1.docs\u002F2.core-concepts\u002F7.middleware",{"title":83,"path":84,"stem":85,"status":11},"Guards","\u002Fdocs\u002Fcore-concepts\u002Fguards","1.docs\u002F2.core-concepts\u002F8.guards",{"title":87,"path":88,"stem":89,"status":11},"Exceptions","\u002Fdocs\u002Fcore-concepts\u002Fexceptions","1.docs\u002F2.core-concepts\u002F9.exceptions",{"title":91,"path":92,"stem":93,"children":94,"status":11,"icon":20},"Packages","\u002Fdocs\u002Fpackages","1.docs\u002F3.packages\u002F1.index",[95,96,101,112,116,120,138,142,146,150,154,158,162],{"title":27,"path":92,"stem":93,"status":11},{"title":97,"path":98,"stem":99,"status":100},"CLI","\u002Fdocs\u002Fpackages\u002Fcli","1.docs\u002F3.packages\u002F10.cli","experimental",{"title":102,"path":103,"stem":104,"children":105,"status":11,"icon":20,"defaultOpen":20},"Events","\u002Fdocs\u002Fpackages\u002Fmessaging","1.docs\u002F3.packages\u002F11.messaging\u002F1.index",[106,108],{"title":27,"path":103,"stem":104,"status":107},"beta",{"title":109,"path":110,"stem":111,"status":100},"Redis","\u002Fdocs\u002Fpackages\u002Fmessaging\u002Fredis","1.docs\u002F3.packages\u002F11.messaging\u002F2.redis",{"title":113,"path":114,"stem":115,"status":107},"Serve Static","\u002Fdocs\u002Fpackages\u002Fserve-static","1.docs\u002F3.packages\u002F12.serve-static",{"title":117,"path":118,"stem":119,"status":107},"Rate Limit","\u002Fdocs\u002Fpackages\u002Frate-limit","1.docs\u002F3.packages\u002F13.rate-limit",{"title":121,"path":122,"stem":123,"children":124,"status":11,"icon":20,"defaultOpen":20},"Auth","\u002Fdocs\u002Fpackages\u002Fauth","1.docs\u002F3.packages\u002F2.auth\u002F1.index",[125,126,130,134],{"title":27,"path":122,"stem":123,"status":107},{"title":127,"path":128,"stem":129,"status":107},"JWT Provider","\u002Fdocs\u002Fpackages\u002Fauth\u002Fjwt","1.docs\u002F3.packages\u002F2.auth\u002F2.jwt",{"title":131,"path":132,"stem":133,"status":107},"Local Provider","\u002Fdocs\u002Fpackages\u002Fauth\u002Flocal","1.docs\u002F3.packages\u002F2.auth\u002F3.local",{"title":135,"path":136,"stem":137,"status":100},"OAuth2 Provider","\u002Fdocs\u002Fpackages\u002Fauth\u002Foauth2","1.docs\u002F3.packages\u002F2.auth\u002F4.oauth2",{"title":139,"path":140,"stem":141,"status":107},"JWT","\u002Fdocs\u002Fpackages\u002Fjwt","1.docs\u002F3.packages\u002F3.jwt",{"title":143,"path":144,"stem":145,"status":107},"Drizzle","\u002Fdocs\u002Fpackages\u002Fdrizzle","1.docs\u002F3.packages\u002F4.drizzle",{"title":147,"path":148,"stem":149,"status":107},"Papr","\u002Fdocs\u002Fpackages\u002Fpapr","1.docs\u002F3.packages\u002F5.papr",{"title":151,"path":152,"stem":153,"status":107},"Mongoose","\u002Fdocs\u002Fpackages\u002Fmongoose","1.docs\u002F3.packages\u002F6.mongoose",{"title":155,"path":156,"stem":157,"status":107},"Swagger","\u002Fdocs\u002Fpackages\u002Fswagger","1.docs\u002F3.packages\u002F7.swagger",{"title":159,"path":160,"stem":161,"status":107},"Node Server","\u002Fdocs\u002Fpackages\u002Fnode-server","1.docs\u002F3.packages\u002F8.node-server",{"title":163,"path":164,"stem":165,"status":107},"uWS Server","\u002Fdocs\u002Fpackages\u002Fuws-server","1.docs\u002F3.packages\u002F9.uws-server",{"title":167,"path":168,"stem":169,"children":170,"status":11,"icon":20},"Roadmap","\u002Fdocs\u002Froadmap","1.docs\u002F4.roadmap\u002F1.index",[171,172,176,180],{"title":27,"path":168,"stem":169,"status":11},{"title":173,"path":174,"stem":175,"status":11},"Short term (0-3 months)","\u002Fdocs\u002Froadmap\u002Fshort-term","1.docs\u002F4.roadmap\u002F2.short-term",{"title":177,"path":178,"stem":179,"status":11},"Mid term (3-9 months)","\u002Fdocs\u002Froadmap\u002Fmid-term","1.docs\u002F4.roadmap\u002F3.mid-term",{"title":181,"path":182,"stem":183,"status":11},"Long term (9-12+ months)","\u002Fdocs\u002Froadmap\u002Flong-term","1.docs\u002F4.roadmap\u002F4.long-term",{"id":185,"title":163,"body":186,"description":1523,"extension":1524,"meta":1525,"navigation":364,"path":164,"seo":1526,"status":107,"stem":165,"__hash__":1527},"docs\u002F1.docs\u002F3.packages\u002F9.uws-server.md",{"type":187,"value":188,"toc":1510},"minimark",[189,209,213,294,299,303,429,432,465,469,483,487,492,495,569,573,652,660,664,782,786,925,948,982,996,1063,1067,1073,1087,1092,1103,1110,1113,1122,1492,1506],[190,191,192,196,197,204,205,208],"p",{},[193,194,195],"code",{},"@miiajs\u002Fuws-server"," provides a high-performance HTTP server adapter using ",[198,199,203],"a",{"href":200,"rel":201},"https:\u002F\u002Fgithub.com\u002FuNetworking\u002FuWebSockets.js",[202],"nofollow","uWebSockets.js"," - a C++ networking library that is significantly faster than Node.js's built-in ",[193,206,207],{},"http"," module.",[210,211,13],"h2",{"id":212},"installation",[214,215,216,244,262,278],"code-group",{},[217,218,224],"pre",{"className":219,"code":220,"filename":221,"language":222,"meta":223,"style":223},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","bun add @miiajs\u002Fuws-server uWebSockets.js@uNetworking\u002FuWebSockets.js#v20.68.0\n","bun","bash","",[193,225,226],{"__ignoreMap":223},[227,228,231,234,238,241],"span",{"class":229,"line":230},"line",1,[227,232,221],{"class":233},"sBMFI",[227,235,237],{"class":236},"sfazB"," add",[227,239,240],{"class":236}," @miiajs\u002Fuws-server",[227,242,243],{"class":236}," uWebSockets.js@uNetworking\u002FuWebSockets.js#v20.68.0\n",[217,245,248],{"className":219,"code":246,"filename":247,"language":222,"meta":223,"style":223},"npm install @miiajs\u002Fuws-server uNetworking\u002FuWebSockets.js#v20.68.0\n","npm",[193,249,250],{"__ignoreMap":223},[227,251,252,254,257,259],{"class":229,"line":230},[227,253,247],{"class":233},[227,255,256],{"class":236}," install",[227,258,240],{"class":236},[227,260,261],{"class":236}," uNetworking\u002FuWebSockets.js#v20.68.0\n",[217,263,266],{"className":219,"code":264,"filename":265,"language":222,"meta":223,"style":223},"pnpm add @miiajs\u002Fuws-server uNetworking\u002FuWebSockets.js#v20.68.0\n","pnpm",[193,267,268],{"__ignoreMap":223},[227,269,270,272,274,276],{"class":229,"line":230},[227,271,265],{"class":233},[227,273,237],{"class":236},[227,275,240],{"class":236},[227,277,261],{"class":236},[217,279,282],{"className":219,"code":280,"filename":281,"language":222,"meta":223,"style":223},"yarn add @miiajs\u002Fuws-server uNetworking\u002FuWebSockets.js#v20.68.0\n","yarn",[193,283,284],{"__ignoreMap":223},[227,285,286,288,290,292],{"class":229,"line":230},[227,287,281],{"class":233},[227,289,237],{"class":236},[227,291,240],{"class":236},[227,293,261],{"class":236},[190,295,296,298],{},[193,297,203],{}," is installed directly from GitHub - the package is not published to npm.",[210,300,302],{"id":301},"usage","Usage",[217,304,308],{"className":305,"code":306,"language":307,"meta":223,"style":223},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { Miia } from '@miiajs\u002Fcore'\nimport { serve } from '@miiajs\u002Fuws-server'\n\nconst app = new Miia().register(AppModule)\n\nawait app.listen(3000, serve)\n","typescript",[193,309,310,339,359,366,397,402],{"__ignoreMap":223},[227,311,312,316,320,324,327,330,333,336],{"class":229,"line":230},[227,313,315],{"class":314},"s7zQu","import",[227,317,319],{"class":318},"sMK4o"," {",[227,321,323],{"class":322},"sTEyZ"," Miia",[227,325,326],{"class":318}," }",[227,328,329],{"class":314}," from",[227,331,332],{"class":318}," '",[227,334,335],{"class":236},"@miiajs\u002Fcore",[227,337,338],{"class":318},"'\n",[227,340,342,344,346,349,351,353,355,357],{"class":229,"line":341},2,[227,343,315],{"class":314},[227,345,319],{"class":318},[227,347,348],{"class":322}," serve",[227,350,326],{"class":318},[227,352,329],{"class":314},[227,354,332],{"class":318},[227,356,195],{"class":236},[227,358,338],{"class":318},[227,360,362],{"class":229,"line":361},3,[227,363,365],{"emptyLinePlaceholder":364},true,"\n",[227,367,369,373,376,379,382,385,388,391,394],{"class":229,"line":368},4,[227,370,372],{"class":371},"spNyl","const",[227,374,375],{"class":322}," app ",[227,377,378],{"class":318},"=",[227,380,381],{"class":318}," new",[227,383,323],{"class":384},"s2Zo4",[227,386,387],{"class":322},"()",[227,389,390],{"class":318},".",[227,392,393],{"class":384},"register",[227,395,396],{"class":322},"(AppModule)\n",[227,398,400],{"class":229,"line":399},5,[227,401,365],{"emptyLinePlaceholder":364},[227,403,405,408,411,413,416,419,423,426],{"class":229,"line":404},6,[227,406,407],{"class":314},"await",[227,409,410],{"class":322}," app",[227,412,390],{"class":318},[227,414,415],{"class":384},"listen",[227,417,418],{"class":322},"(",[227,420,422],{"class":421},"sbssI","3000",[227,424,425],{"class":318},",",[227,427,428],{"class":322}," serve)\n",[190,430,431],{},"With custom hostname:",[217,433,435],{"className":305,"code":434,"language":307,"meta":223,"style":223},"await app.listen(3000, '0.0.0.0', serve)\n",[193,436,437],{"__ignoreMap":223},[227,438,439,441,443,445,447,449,451,453,455,458,461,463],{"class":229,"line":230},[227,440,407],{"class":314},[227,442,410],{"class":322},[227,444,390],{"class":318},[227,446,415],{"class":384},[227,448,418],{"class":322},[227,450,422],{"class":421},[227,452,425],{"class":318},[227,454,332],{"class":318},[227,456,457],{"class":236},"0.0.0.0",[227,459,460],{"class":318},"'",[227,462,425],{"class":318},[227,464,428],{"class":322},[210,466,468],{"id":467},"how-it-works","How it works",[190,470,471,472,475,476,478,479,482],{},"The adapter converts uWebSockets.js request\u002Fresponse objects to the Web Standard ",[193,473,474],{},"Request","\u002F",[193,477,29],{}," API that MiiaJS expects. Since uWS ",[193,480,481],{},"HttpRequest"," is only valid synchronously, all metadata (method, URL, headers) is captured before any async gap.",[210,484,486],{"id":485},"performance-modes","Performance modes",[488,489,491],"h3",{"id":490},"optimized-mode-default","Optimized mode (default)",[190,493,494],{},"Minimizes allocations on the hot path:",[496,497,498,510,520,537,550,559],"ul",{},[499,500,501,505,506,509],"li",{},[502,503,504],"strong",{},"Lazy Request Proxy"," - lightweight object instead of ",[193,507,508],{},"new Request()",". Method, URL, headers, and body are resolved only on first access.",[499,511,512,515,516,519],{},[502,513,514],{},"Lightweight Headers"," - linear scan over header pairs instead of constructing a ",[193,517,518],{},"Headers"," object. uWS provides lowercase keys natively, so lookups are direct string comparisons.",[499,521,522,525,526,529,530,533,534,536],{},[502,523,524],{},"Body Buffering"," - small POST bodies (Content-Length ≤ ",[193,527,528],{},"bufferThreshold",") are buffered and parsed directly, bypassing ",[193,531,532],{},"ReadableStream"," and ",[193,535,474],{}," creation. Large or chunked bodies fall back to streaming.",[499,538,539,542,543,546,547,549],{},[502,540,541],{},"LightResponse Cache"," - simple responses (string, null, Uint8Array) store a ",[193,544,545],{},"[status, body, headers]"," tuple without creating a real ",[193,548,29],{}," object.",[499,551,552,555,556,390],{},[502,553,554],{},"Corked Writes"," - batches header + body writes into a single syscall via ",[193,557,558],{},"res.cork()",[499,560,561,564,565,568],{},[502,562,563],{},"Sync Fast Path"," - synchronous handlers bypass ",[193,566,567],{},"Promise"," allocation entirely.",[488,570,572],{"id":571},"native-mode","Native mode",[217,574,576],{"className":305,"code":575,"language":307,"meta":223,"style":223},"const server = await serve({\n  fetch: app.fetch,\n  port: 3000,\n  mode: 'native',\n})\n",[193,577,578,597,616,628,644],{"__ignoreMap":223},[227,579,580,582,585,587,590,592,594],{"class":229,"line":230},[227,581,372],{"class":371},[227,583,584],{"class":322}," server ",[227,586,378],{"class":318},[227,588,589],{"class":314}," await",[227,591,348],{"class":384},[227,593,418],{"class":322},[227,595,596],{"class":318},"{\n",[227,598,599,603,606,608,610,613],{"class":229,"line":341},[227,600,602],{"class":601},"swJcz","  fetch",[227,604,605],{"class":318},":",[227,607,410],{"class":322},[227,609,390],{"class":318},[227,611,612],{"class":322},"fetch",[227,614,615],{"class":318},",\n",[227,617,618,621,623,626],{"class":229,"line":361},[227,619,620],{"class":601},"  port",[227,622,605],{"class":318},[227,624,625],{"class":421}," 3000",[227,627,615],{"class":318},[227,629,630,633,635,637,640,642],{"class":229,"line":368},[227,631,632],{"class":601},"  mode",[227,634,605],{"class":318},[227,636,332],{"class":318},[227,638,639],{"class":236},"native",[227,641,460],{"class":318},[227,643,615],{"class":318},[227,645,646,649],{"class":229,"line":399},[227,647,648],{"class":318},"}",[227,650,651],{"class":322},")\n",[190,653,654,655,533,657,659],{},"Full Web API compliance with standard ",[193,656,474],{},[193,658,29],{}," objects. Use when strict spec conformance is needed.",[210,661,663],{"id":662},"standalone-usage","Standalone usage",[217,665,667],{"className":305,"code":666,"language":307,"meta":223,"style":223},"import { serve } from '@miiajs\u002Fuws-server'\n\nconst server = await serve({\n  fetch: (req) => new Response('Hello, World!'),\n  port: 8080,\n})\n\nawait server.close()\n",[193,668,669,687,691,707,744,755,761,766],{"__ignoreMap":223},[227,670,671,673,675,677,679,681,683,685],{"class":229,"line":230},[227,672,315],{"class":314},[227,674,319],{"class":318},[227,676,348],{"class":322},[227,678,326],{"class":318},[227,680,329],{"class":314},[227,682,332],{"class":318},[227,684,195],{"class":236},[227,686,338],{"class":318},[227,688,689],{"class":229,"line":341},[227,690,365],{"emptyLinePlaceholder":364},[227,692,693,695,697,699,701,703,705],{"class":229,"line":361},[227,694,372],{"class":371},[227,696,584],{"class":322},[227,698,378],{"class":318},[227,700,589],{"class":314},[227,702,348],{"class":384},[227,704,418],{"class":322},[227,706,596],{"class":318},[227,708,709,711,713,716,720,723,726,728,731,733,735,738,740,742],{"class":229,"line":368},[227,710,602],{"class":384},[227,712,605],{"class":318},[227,714,715],{"class":318}," (",[227,717,719],{"class":718},"sHdIc","req",[227,721,722],{"class":318},")",[227,724,725],{"class":371}," =>",[227,727,381],{"class":318},[227,729,730],{"class":384}," Response",[227,732,418],{"class":322},[227,734,460],{"class":318},[227,736,737],{"class":236},"Hello, World!",[227,739,460],{"class":318},[227,741,722],{"class":322},[227,743,615],{"class":318},[227,745,746,748,750,753],{"class":229,"line":399},[227,747,620],{"class":601},[227,749,605],{"class":318},[227,751,752],{"class":421}," 8080",[227,754,615],{"class":318},[227,756,757,759],{"class":229,"line":404},[227,758,648],{"class":318},[227,760,651],{"class":322},[227,762,764],{"class":229,"line":763},7,[227,765,365],{"emptyLinePlaceholder":364},[227,767,769,771,774,776,779],{"class":229,"line":768},8,[227,770,407],{"class":314},[227,772,773],{"class":322}," server",[227,775,390],{"class":318},[227,777,778],{"class":384},"close",[227,780,781],{"class":322},"()\n",[210,783,785],{"id":784},"options","Options",[217,787,789],{"className":305,"code":788,"language":307,"meta":223,"style":223},"interface ServeOptions {\n  fetch: (req: Request) => Response | Promise\u003CResponse>  \u002F\u002F Required\n  port?: number              \u002F\u002F Default: 3000\n  hostname?: string          \u002F\u002F Default: '0.0.0.0'\n  mode?: 'optimized' | 'native'  \u002F\u002F Default: 'optimized'\n  bufferThreshold?: number   \u002F\u002F Default: 102400 (100KB)\n  maxBodySize?: number | false   \u002F\u002F Default: 1048576 (1MB)\n}\n",[193,790,791,802,841,854,867,891,903,920],{"__ignoreMap":223},[227,792,793,796,799],{"class":229,"line":230},[227,794,795],{"class":371},"interface",[227,797,798],{"class":233}," ServeOptions",[227,800,801],{"class":318}," {\n",[227,803,804,806,808,810,812,814,817,819,821,823,826,829,832,834,837],{"class":229,"line":341},[227,805,602],{"class":601},[227,807,605],{"class":318},[227,809,715],{"class":318},[227,811,719],{"class":718},[227,813,605],{"class":318},[227,815,816],{"class":233}," Request",[227,818,722],{"class":318},[227,820,725],{"class":371},[227,822,730],{"class":233},[227,824,825],{"class":318}," |",[227,827,828],{"class":233}," Promise",[227,830,831],{"class":318},"\u003C",[227,833,29],{"class":233},[227,835,836],{"class":318},">",[227,838,840],{"class":839},"sHwdD","  \u002F\u002F Required\n",[227,842,843,845,848,851],{"class":229,"line":361},[227,844,620],{"class":601},[227,846,847],{"class":318},"?:",[227,849,850],{"class":233}," number",[227,852,853],{"class":839},"              \u002F\u002F Default: 3000\n",[227,855,856,859,861,864],{"class":229,"line":368},[227,857,858],{"class":601},"  hostname",[227,860,847],{"class":318},[227,862,863],{"class":233}," string",[227,865,866],{"class":839},"          \u002F\u002F Default: '0.0.0.0'\n",[227,868,869,871,873,875,878,880,882,884,886,888],{"class":229,"line":399},[227,870,632],{"class":601},[227,872,847],{"class":318},[227,874,332],{"class":318},[227,876,877],{"class":236},"optimized",[227,879,460],{"class":318},[227,881,825],{"class":318},[227,883,332],{"class":318},[227,885,639],{"class":236},[227,887,460],{"class":318},[227,889,890],{"class":839},"  \u002F\u002F Default: 'optimized'\n",[227,892,893,896,898,900],{"class":229,"line":404},[227,894,895],{"class":601},"  bufferThreshold",[227,897,847],{"class":318},[227,899,850],{"class":233},[227,901,902],{"class":839},"   \u002F\u002F Default: 102400 (100KB)\n",[227,904,905,908,910,912,914,917],{"class":229,"line":763},[227,906,907],{"class":601},"  maxBodySize",[227,909,847],{"class":318},[227,911,850],{"class":233},[227,913,825],{"class":318},[227,915,916],{"class":233}," false",[227,918,919],{"class":839},"   \u002F\u002F Default: 1048576 (1MB)\n",[227,921,922],{"class":229,"line":768},[227,923,924],{"class":318},"}\n",[190,926,927,928,930,931,934,935,475,938,941,942,944,945,947],{},"The ",[193,929,528],{}," controls the body buffering optimization in optimized mode. POST\u002FPUT\u002FPATCH bodies with a known ",[193,932,933],{},"Content-Length"," up to this size are buffered in memory for fast ",[193,936,937],{},"json()",[193,939,940],{},"text()"," access. Bodies without ",[193,943,933],{}," or larger than the threshold use ",[193,946,532],{}," for streaming.",[190,949,927,950,953,954,956,957,960,961,963,964,967,968,971,972,974,975,977,978,981],{},[193,951,952],{},"maxBodySize"," caps request bodies. A request whose declared ",[193,955,933],{}," exceeds the cap gets an immediate ",[193,958,959],{},"413"," JSON response - the handler never runs. Chunked bodies (no ",[193,962,933],{},") are capped in-stream: the body stream rejects with an ",[193,965,966],{},"Error"," named ",[193,969,970],{},"'PayloadTooLargeError'",", which ",[193,973,335],{}," maps to a ",[193,976,959],{}," automatically. Non-Miia consumers should catch this error by name. Pass ",[193,979,980],{},"false"," to disable the cap.",[190,983,984,985,988,989,991,992,995],{},"When used via ",[193,986,987],{},"app.listen(port, serve)",", Miia passes its computed ceiling (max of ",[193,990,952],{}," and all ",[193,993,994],{},"@BodyLimit"," values) automatically. To override it for the adapter, wrap the call:",[217,997,999],{"className":305,"code":998,"language":307,"meta":223,"style":223},"await app.listen(3000, (info) => serve({ ...info, maxBodySize: 5 * 1024 * 1024 }))\n",[193,1000,1001],{"__ignoreMap":223},[227,1002,1003,1005,1007,1009,1011,1013,1015,1017,1019,1022,1024,1026,1028,1030,1033,1036,1038,1040,1043,1045,1048,1051,1054,1056,1058,1060],{"class":229,"line":230},[227,1004,407],{"class":314},[227,1006,410],{"class":322},[227,1008,390],{"class":318},[227,1010,415],{"class":384},[227,1012,418],{"class":322},[227,1014,422],{"class":421},[227,1016,425],{"class":318},[227,1018,715],{"class":318},[227,1020,1021],{"class":718},"info",[227,1023,722],{"class":318},[227,1025,725],{"class":371},[227,1027,348],{"class":384},[227,1029,418],{"class":322},[227,1031,1032],{"class":318},"{",[227,1034,1035],{"class":318}," ...",[227,1037,1021],{"class":322},[227,1039,425],{"class":318},[227,1041,1042],{"class":601}," maxBodySize",[227,1044,605],{"class":318},[227,1046,1047],{"class":421}," 5",[227,1049,1050],{"class":318}," *",[227,1052,1053],{"class":421}," 1024",[227,1055,1050],{"class":318},[227,1057,1053],{"class":421},[227,1059,326],{"class":318},[227,1061,1062],{"class":322},"))\n",[210,1064,1066],{"id":1065},"when-to-use","When to use",[190,1068,1069,1070,1072],{},"Choose ",[193,1071,195],{}," when:",[496,1074,1075,1078,1084],{},[499,1076,1077],{},"Maximum throughput is critical",[499,1079,1080,1081,1083],{},"You're running on Node.js and need higher performance than the built-in ",[193,1082,207],{}," module",[499,1085,1086],{},"You're comfortable with native binary dependencies",[190,1088,1069,1089,1072],{},[193,1090,1091],{},"@miiajs\u002Fnode-server",[496,1093,1094,1097,1100],{},[499,1095,1096],{},"You prefer zero native dependencies",[499,1098,1099],{},"You need broader platform compatibility",[499,1101,1102],{},"Performance is sufficient with the Node.js adapter",[190,1104,1105,1106,1109],{},"On Bun and Deno, no adapter is needed - ",[193,1107,1108],{},"app.listen()"," auto-detects the runtime.",[210,1111,37],{"id":1112},"testing",[190,1114,1115,1117,1118,1121],{},[193,1116,195],{}," is exercised directly via ",[193,1119,1120],{},"serve()",". Tests must run under Node.js - the native uWS binary does not load on Bun or Deno.",[217,1123,1125],{"className":305,"code":1124,"language":307,"meta":223,"style":223},"\u002F\u002F node --experimental-strip-types --no-warnings --test\nimport { afterEach, describe, it } from 'node:test'\nimport assert from 'node:assert\u002Fstrict'\nimport { serve } from '@miiajs\u002Fuws-server'\n\nlet server: { close(): Promise\u003Cvoid> }\n\nafterEach(async () => {\n  if (server) await server.close()\n})\n\nit('handles GET requests', async () => {\n  server = await serve({\n    port: 19234,\n    fetch: () => Response.json({ ok: true }),\n  })\n\n  const res = await fetch('http:\u002F\u002Flocalhost:19234\u002F')\n  assert.equal(res.status, 200)\n  assert.deepEqual(await res.json(), { ok: true })\n})\n",[193,1126,1127,1132,1162,1179,1197,1201,1230,1234,1251,1275,1282,1287,1313,1330,1343,1381,1389,1394,1421,1449,1485],{"__ignoreMap":223},[227,1128,1129],{"class":229,"line":230},[227,1130,1131],{"class":839},"\u002F\u002F node --experimental-strip-types --no-warnings --test\n",[227,1133,1134,1136,1138,1141,1143,1146,1148,1151,1153,1155,1157,1160],{"class":229,"line":341},[227,1135,315],{"class":314},[227,1137,319],{"class":318},[227,1139,1140],{"class":322}," afterEach",[227,1142,425],{"class":318},[227,1144,1145],{"class":322}," describe",[227,1147,425],{"class":318},[227,1149,1150],{"class":322}," it",[227,1152,326],{"class":318},[227,1154,329],{"class":314},[227,1156,332],{"class":318},[227,1158,1159],{"class":236},"node:test",[227,1161,338],{"class":318},[227,1163,1164,1166,1169,1172,1174,1177],{"class":229,"line":361},[227,1165,315],{"class":314},[227,1167,1168],{"class":322}," assert ",[227,1170,1171],{"class":314},"from",[227,1173,332],{"class":318},[227,1175,1176],{"class":236},"node:assert\u002Fstrict",[227,1178,338],{"class":318},[227,1180,1181,1183,1185,1187,1189,1191,1193,1195],{"class":229,"line":368},[227,1182,315],{"class":314},[227,1184,319],{"class":318},[227,1186,348],{"class":322},[227,1188,326],{"class":318},[227,1190,329],{"class":314},[227,1192,332],{"class":318},[227,1194,195],{"class":236},[227,1196,338],{"class":318},[227,1198,1199],{"class":229,"line":399},[227,1200,365],{"emptyLinePlaceholder":364},[227,1202,1203,1206,1208,1210,1212,1215,1218,1220,1222,1225,1227],{"class":229,"line":404},[227,1204,1205],{"class":371},"let",[227,1207,773],{"class":322},[227,1209,605],{"class":318},[227,1211,319],{"class":318},[227,1213,1214],{"class":601}," close",[227,1216,1217],{"class":318},"():",[227,1219,828],{"class":233},[227,1221,831],{"class":318},[227,1223,1224],{"class":233},"void",[227,1226,836],{"class":318},[227,1228,1229],{"class":318}," }\n",[227,1231,1232],{"class":229,"line":763},[227,1233,365],{"emptyLinePlaceholder":364},[227,1235,1236,1239,1241,1244,1247,1249],{"class":229,"line":768},[227,1237,1238],{"class":384},"afterEach",[227,1240,418],{"class":322},[227,1242,1243],{"class":371},"async",[227,1245,1246],{"class":318}," ()",[227,1248,725],{"class":371},[227,1250,801],{"class":318},[227,1252,1254,1257,1259,1262,1265,1267,1269,1271,1273],{"class":229,"line":1253},9,[227,1255,1256],{"class":314},"  if",[227,1258,715],{"class":601},[227,1260,1261],{"class":322},"server",[227,1263,1264],{"class":601},") ",[227,1266,407],{"class":314},[227,1268,773],{"class":322},[227,1270,390],{"class":318},[227,1272,778],{"class":384},[227,1274,781],{"class":601},[227,1276,1278,1280],{"class":229,"line":1277},10,[227,1279,648],{"class":318},[227,1281,651],{"class":322},[227,1283,1285],{"class":229,"line":1284},11,[227,1286,365],{"emptyLinePlaceholder":364},[227,1288,1290,1293,1295,1297,1300,1302,1304,1307,1309,1311],{"class":229,"line":1289},12,[227,1291,1292],{"class":384},"it",[227,1294,418],{"class":322},[227,1296,460],{"class":318},[227,1298,1299],{"class":236},"handles GET requests",[227,1301,460],{"class":318},[227,1303,425],{"class":318},[227,1305,1306],{"class":371}," async",[227,1308,1246],{"class":318},[227,1310,725],{"class":371},[227,1312,801],{"class":318},[227,1314,1316,1319,1322,1324,1326,1328],{"class":229,"line":1315},13,[227,1317,1318],{"class":322},"  server",[227,1320,1321],{"class":318}," =",[227,1323,589],{"class":314},[227,1325,348],{"class":384},[227,1327,418],{"class":601},[227,1329,596],{"class":318},[227,1331,1333,1336,1338,1341],{"class":229,"line":1332},14,[227,1334,1335],{"class":601},"    port",[227,1337,605],{"class":318},[227,1339,1340],{"class":421}," 19234",[227,1342,615],{"class":318},[227,1344,1346,1349,1351,1353,1355,1357,1359,1362,1364,1366,1369,1371,1375,1377,1379],{"class":229,"line":1345},15,[227,1347,1348],{"class":384},"    fetch",[227,1350,605],{"class":318},[227,1352,1246],{"class":318},[227,1354,725],{"class":371},[227,1356,730],{"class":322},[227,1358,390],{"class":318},[227,1360,1361],{"class":384},"json",[227,1363,418],{"class":601},[227,1365,1032],{"class":318},[227,1367,1368],{"class":601}," ok",[227,1370,605],{"class":318},[227,1372,1374],{"class":1373},"sfNiH"," true",[227,1376,326],{"class":318},[227,1378,722],{"class":601},[227,1380,615],{"class":318},[227,1382,1384,1387],{"class":229,"line":1383},16,[227,1385,1386],{"class":318},"  }",[227,1388,651],{"class":601},[227,1390,1392],{"class":229,"line":1391},17,[227,1393,365],{"emptyLinePlaceholder":364},[227,1395,1397,1400,1403,1405,1407,1410,1412,1414,1417,1419],{"class":229,"line":1396},18,[227,1398,1399],{"class":371},"  const",[227,1401,1402],{"class":322}," res",[227,1404,1321],{"class":318},[227,1406,589],{"class":314},[227,1408,1409],{"class":384}," fetch",[227,1411,418],{"class":601},[227,1413,460],{"class":318},[227,1415,1416],{"class":236},"http:\u002F\u002Flocalhost:19234\u002F",[227,1418,460],{"class":318},[227,1420,651],{"class":601},[227,1422,1424,1427,1429,1432,1434,1437,1439,1442,1444,1447],{"class":229,"line":1423},19,[227,1425,1426],{"class":322},"  assert",[227,1428,390],{"class":318},[227,1430,1431],{"class":384},"equal",[227,1433,418],{"class":601},[227,1435,1436],{"class":322},"res",[227,1438,390],{"class":318},[227,1440,1441],{"class":322},"status",[227,1443,425],{"class":318},[227,1445,1446],{"class":421}," 200",[227,1448,651],{"class":601},[227,1450,1452,1454,1456,1459,1461,1463,1465,1467,1469,1471,1473,1475,1477,1479,1481,1483],{"class":229,"line":1451},20,[227,1453,1426],{"class":322},[227,1455,390],{"class":318},[227,1457,1458],{"class":384},"deepEqual",[227,1460,418],{"class":601},[227,1462,407],{"class":314},[227,1464,1402],{"class":322},[227,1466,390],{"class":318},[227,1468,1361],{"class":384},[227,1470,387],{"class":601},[227,1472,425],{"class":318},[227,1474,319],{"class":318},[227,1476,1368],{"class":601},[227,1478,605],{"class":318},[227,1480,1374],{"class":1373},[227,1482,326],{"class":318},[227,1484,651],{"class":601},[227,1486,1488,1490],{"class":229,"line":1487},21,[227,1489,648],{"class":318},[227,1491,651],{"class":322},[190,1493,1494,1495,1498,1499,1502,1503,1505],{},"For applications that wire the adapter through ",[193,1496,1497],{},"app.listen(port, host, serve)",", prefer the ",[193,1500,1501],{},"TestApp"," pattern from ",[198,1504,37],{"href":38}," - it runs handlers without binding a port and works under any runtime.",[1507,1508,1509],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":223,"searchDepth":341,"depth":341,"links":1511},[1512,1513,1514,1515,1519,1520,1521,1522],{"id":212,"depth":341,"text":13},{"id":301,"depth":341,"text":302},{"id":467,"depth":341,"text":468},{"id":485,"depth":341,"text":486,"children":1516},[1517,1518],{"id":490,"depth":361,"text":491},{"id":571,"depth":361,"text":572},{"id":662,"depth":341,"text":663},{"id":784,"depth":341,"text":785},{"id":1065,"depth":341,"text":1066},{"id":1112,"depth":341,"text":37},"uWebSockets.js HTTP server adapter for maximum throughput.","md",{},{"title":163,"description":1523},"LKyoK7AwzIGU0JYmtqssXauAap38u40XLiXEBnmNmno",[1529,1531],{"title":159,"path":160,"stem":161,"description":1530,"children":-1},"Node.js HTTP server adapter with optimized request\u002Fresponse handling.",{"title":27,"path":168,"stem":169,"description":1532,"children":-1},"Public roadmap for MiiaJS - what is shipped, what is coming, and how items are prioritized.",1784659936073]