[{"data":1,"prerenderedAt":2480},["ShallowReactive",2],{"navigation":3,"-guide-options":56,"-guide-options-surround":2475},[4],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Getting Started","/guide","1.guide/1.index",[9,11,16,21,26,31,36,41,46,51],{"title":5,"path":6,"stem":7,"icon":10},"ph:book-open-duotone",{"title":12,"path":13,"stem":14,"icon":15},"Using CLI","/guide/cli","1.guide/10.cli","garden:terminal-cli-stroke-12",{"title":17,"path":18,"stem":19,"icon":20},"Fetch Handler","/guide/handler","1.guide/2.handler","i-fluent:target-24-regular",{"title":22,"path":23,"stem":24,"icon":25},"Server Instance","/guide/server","1.guide/3.server","radix-icons:component-instance",{"title":27,"path":28,"stem":29,"icon":30},"Middleware","/guide/middleware","1.guide/4.middleware","clarity:plugin-line",{"title":32,"path":33,"stem":34,"icon":35},"Server Options","/guide/options","1.guide/5.options","ri:settings-3-line",{"title":37,"path":38,"stem":39,"icon":40},"TLS","/guide/tls","1.guide/6.tls","ri:lock-2-line",{"title":42,"path":43,"stem":44,"icon":45},"Bundler Usage","/guide/bundler","1.guide/7.bundler","clarity:bundle-line",{"title":47,"path":48,"stem":49,"icon":50},"Node.js Support","/guide/node","1.guide/8.node","akar-icons:node-fill",{"title":52,"path":53,"stem":54,"icon":55},"AWS Lambda","/guide/aws-lambda","1.guide/9.aws-lambda","clarity:cloud-traffic-line",{"id":57,"title":32,"body":58,"description":2469,"extension":2470,"meta":2471,"navigation":2472,"path":33,"seo":2473,"stem":34,"__hash__":2474},"content/1.guide/5.options.md",{"type":59,"value":60,"toc":2442,"icon":35},"minimark",[61,70,223,226,236,241,247,250,260,270,275,278,296,305,311,314,324,329,336,341,360,461,468,473,482,615,618,623,632,742,751,756,759,769,789,794,797,802,868,873,893,906,916,919,925,928,935,939,1065,1071,1082,1109,1137,1141,1309,1349,1355,1386,1401,1435,1439,1512,1517,1521,1525,1529,1625,1641,1644,1648,1769,1774,1777,1781,1900,1906,1910,1916,2001,2014,2018,2021,2163,2167,2174,2189,2193,2199,2337,2341,2364,2428,2438],[62,63,64,65,69],"p",{},"When starting a new server, in addition to main ",[66,67,68],"code",{},"fetch"," handler, you can provide additional options to customize listening server.",[71,72,77],"pre",{"className":73,"code":74,"language":75,"meta":76,"style":76},"language-js shiki shiki-themes github-light github-dark github-dark","import { serve } from \"srvx\";\n\nserve({\n  // Generic options\n  port: 3000,\n  hostname: \"localhost\",\n\n  // Runtime specific options\n  node: {},\n  bun: {},\n  deno: {},\n\n  // Main server handler\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n","js","",[66,78,79,102,109,119,126,139,150,155,161,167,173,179,184,190,217],{"__ignoreMap":76},[80,81,84,88,92,95,99],"span",{"class":82,"line":83},"line",1,[80,85,87],{"class":86},"so5gQ","import",[80,89,91],{"class":90},"slsVL"," { serve } ",[80,93,94],{"class":86},"from",[80,96,98],{"class":97},"sfrk1"," \"srvx\"",[80,100,101],{"class":90},";\n",[80,103,105],{"class":82,"line":104},2,[80,106,108],{"emptyLinePlaceholder":107},true,"\n",[80,110,112,116],{"class":82,"line":111},3,[80,113,115],{"class":114},"shcOC","serve",[80,117,118],{"class":90},"({\n",[80,120,122],{"class":82,"line":121},4,[80,123,125],{"class":124},"sCsY4","  // Generic options\n",[80,127,129,132,136],{"class":82,"line":128},5,[80,130,131],{"class":90},"  port: ",[80,133,135],{"class":134},"suiK_","3000",[80,137,138],{"class":90},",\n",[80,140,142,145,148],{"class":82,"line":141},6,[80,143,144],{"class":90},"  hostname: ",[80,146,147],{"class":97},"\"localhost\"",[80,149,138],{"class":90},[80,151,153],{"class":82,"line":152},7,[80,154,108],{"emptyLinePlaceholder":107},[80,156,158],{"class":82,"line":157},8,[80,159,160],{"class":124},"  // Runtime specific options\n",[80,162,164],{"class":82,"line":163},9,[80,165,166],{"class":90},"  node: {},\n",[80,168,170],{"class":82,"line":169},10,[80,171,172],{"class":90},"  bun: {},\n",[80,174,176],{"class":82,"line":175},11,[80,177,178],{"class":90},"  deno: {},\n",[80,180,182],{"class":82,"line":181},12,[80,183,108],{"emptyLinePlaceholder":107},[80,185,187],{"class":82,"line":186},13,[80,188,189],{"class":124},"  // Main server handler\n",[80,191,193,196,199,202,205,208,211,214],{"class":82,"line":192},14,[80,194,195],{"class":114},"  fetch",[80,197,198],{"class":90},": () ",[80,200,201],{"class":86},"=>",[80,203,204],{"class":86}," new",[80,206,207],{"class":114}," Response",[80,209,210],{"class":90},"(",[80,212,213],{"class":97},"\"👋 Hello there!\"",[80,215,216],{"class":90},"),\n",[80,218,220],{"class":82,"line":219},15,[80,221,222],{"class":90},"});\n",[62,224,225],{},"There are two kind of options:",[227,228,229,233],"ul",{},[230,231,232],"li",{},"Generic options: Top level options are intended to have exactly same functionality regardless of runtime",[230,234,235],{},"Runtime specific: Allow customizing more runtime specific options",[237,238,240],"h2",{"id":239},"generic-options","Generic Options",[242,243,245],"h3",{"id":244},"port",[66,246,244],{},[62,248,249],{},"The port server should be listening to.",[62,251,252,253,256,257,259],{},"Default is value of ",[66,254,255],{},"PORT"," environment variable or ",[66,258,135],{},".",[261,262,263],"tip",{},[62,264,265,266,269],{},"\nYou can set the port to ",[66,267,268],{},"0"," to use a random port.",[242,271,273],{"id":272},"hostname",[66,274,272],{},[62,276,277],{},"The hostname (IP or resolvable host) server listener should bound to.",[62,279,280,281,284,285,287,288,290,291,295],{},"Default is value of the ",[66,282,283],{},"HOST"," environment variable, if set. When neither ",[66,286,272],{}," nor ",[66,289,283],{}," is provided, the server will ",[292,293,294],"strong",{},"listen to all network interfaces"," by default.",[297,298,299],"important",{},[62,300,301,302,259],{},"\nIf you are running a server that should not be exposed to the network, use ",[66,303,304],{},"localhost",[242,306,308],{"id":307},"reuseport",[66,309,310],{},"reusePort",[62,312,313],{},"Enabling this option allows multiple processes to bind to the same port, which is useful for load balancing.",[315,316,317],"note",{},[62,318,319,320,323],{},"\nDespite Node.js built-in behavior that has ",[66,321,322],{},"exclusive"," flag enabled by default, srvx uses non-exclusive mode for consistency.",[242,325,327],{"id":326},"silent",[66,328,326],{},[62,330,331,332,335],{},"If enabled, no server listening message will be printed (enabled by default when ",[66,333,334],{},"TEST"," environment variable is set).",[242,337,339],{"id":338},"manual",[66,340,338],{},[62,342,343,344,347,348,351,352,359],{},"If set to ",[66,345,346],{},"true",", the server will ",[292,349,350],{},"not"," start listening automatically. You must call ",[353,354,356],"a",{"href":355},"/guide/server#serverserve",[66,357,358],{},"server.serve()"," yourself to begin accepting connections. Useful when you need to fully construct the server before it starts.",[71,361,363],{"className":73,"code":362,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nconst server = serve({\n  manual: true,\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n\n// ...later\nawait server.serve();\nawait server.ready();\n",[66,364,365,377,381,397,406,424,428,432,437,450],{"__ignoreMap":76},[80,366,367,369,371,373,375],{"class":82,"line":83},[80,368,87],{"class":86},[80,370,91],{"class":90},[80,372,94],{"class":86},[80,374,98],{"class":97},[80,376,101],{"class":90},[80,378,379],{"class":82,"line":104},[80,380,108],{"emptyLinePlaceholder":107},[80,382,383,386,389,392,395],{"class":82,"line":111},[80,384,385],{"class":86},"const",[80,387,388],{"class":134}," server",[80,390,391],{"class":86}," =",[80,393,394],{"class":114}," serve",[80,396,118],{"class":90},[80,398,399,402,404],{"class":82,"line":121},[80,400,401],{"class":90},"  manual: ",[80,403,346],{"class":134},[80,405,138],{"class":90},[80,407,408,410,412,414,416,418,420,422],{"class":82,"line":128},[80,409,195],{"class":114},[80,411,198],{"class":90},[80,413,201],{"class":86},[80,415,204],{"class":86},[80,417,207],{"class":114},[80,419,210],{"class":90},[80,421,213],{"class":97},[80,423,216],{"class":90},[80,425,426],{"class":82,"line":141},[80,427,222],{"class":90},[80,429,430],{"class":82,"line":152},[80,431,108],{"emptyLinePlaceholder":107},[80,433,434],{"class":82,"line":157},[80,435,436],{"class":124},"// ...later\n",[80,438,439,442,445,447],{"class":82,"line":163},[80,440,441],{"class":86},"await",[80,443,444],{"class":90}," server.",[80,446,115],{"class":114},[80,448,449],{"class":90},"();\n",[80,451,452,454,456,459],{"class":82,"line":169},[80,453,441],{"class":86},[80,455,444],{"class":90},[80,457,458],{"class":114},"ready",[80,460,449],{"class":90},[315,462,463],{},[62,464,465,467],{},[66,466,338],{}," is meaningless on module-worker style runtimes (Cloudflare module syntax, Bunny), where the runtime drives the request lifecycle and there is no listening step to defer.",[242,469,471],{"id":470},"middleware",[66,472,470],{},[62,474,475,476,478,479,481],{},"An array of ",[353,477,470],{"href":28}," handlers to run before the main ",[66,480,68],{}," handler.",[71,483,485],{"className":73,"code":484,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  middleware: [\n    (request, next) => {\n      console.log(`[${request.method}] ${request.url}`);\n      return next();\n    },\n  ],\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,486,487,499,503,509,514,537,573,583,588,593,611],{"__ignoreMap":76},[80,488,489,491,493,495,497],{"class":82,"line":83},[80,490,87],{"class":86},[80,492,91],{"class":90},[80,494,94],{"class":86},[80,496,98],{"class":97},[80,498,101],{"class":90},[80,500,501],{"class":82,"line":104},[80,502,108],{"emptyLinePlaceholder":107},[80,504,505,507],{"class":82,"line":111},[80,506,115],{"class":114},[80,508,118],{"class":90},[80,510,511],{"class":82,"line":121},[80,512,513],{"class":90},"  middleware: [\n",[80,515,516,519,523,526,529,532,534],{"class":82,"line":128},[80,517,518],{"class":90},"    (",[80,520,522],{"class":521},"sQHwn","request",[80,524,525],{"class":90},", ",[80,527,528],{"class":521},"next",[80,530,531],{"class":90},") ",[80,533,201],{"class":86},[80,535,536],{"class":90}," {\n",[80,538,539,542,545,547,550,552,554,557,560,562,564,567,570],{"class":82,"line":141},[80,540,541],{"class":90},"      console.",[80,543,544],{"class":114},"log",[80,546,210],{"class":90},[80,548,549],{"class":97},"`[${",[80,551,522],{"class":90},[80,553,259],{"class":97},[80,555,556],{"class":90},"method",[80,558,559],{"class":97},"}] ${",[80,561,522],{"class":90},[80,563,259],{"class":97},[80,565,566],{"class":90},"url",[80,568,569],{"class":97},"}`",[80,571,572],{"class":90},");\n",[80,574,575,578,581],{"class":82,"line":152},[80,576,577],{"class":86},"      return",[80,579,580],{"class":114}," next",[80,582,449],{"class":90},[80,584,585],{"class":82,"line":157},[80,586,587],{"class":90},"    },\n",[80,589,590],{"class":82,"line":163},[80,591,592],{"class":90},"  ],\n",[80,594,595,597,599,601,603,605,607,609],{"class":82,"line":169},[80,596,195],{"class":114},[80,598,198],{"class":90},[80,600,201],{"class":86},[80,602,204],{"class":86},[80,604,207],{"class":114},[80,606,210],{"class":90},[80,608,213],{"class":97},[80,610,216],{"class":90},[80,612,613],{"class":82,"line":175},[80,614,222],{"class":90},[616,617],"read-more",{"to":28,"title":27},[242,619,621],{"id":620},"plugins",[66,622,620],{},[62,624,475,625,627,628,631],{},[353,626,620],{"href":28}," to extend the server. A plugin is a ",[292,629,630],{},"synchronous"," function that receives the server instance and can register middleware, hook into the lifecycle, or augment requests.",[71,633,635],{"className":73,"code":634,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nconst myPlugin = (server) => {\n  server.options.middleware.push((request, next) => next());\n};\n\nserve({\n  plugins: [myPlugin],\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,636,637,649,653,674,700,705,709,715,720,738],{"__ignoreMap":76},[80,638,639,641,643,645,647],{"class":82,"line":83},[80,640,87],{"class":86},[80,642,91],{"class":90},[80,644,94],{"class":86},[80,646,98],{"class":97},[80,648,101],{"class":90},[80,650,651],{"class":82,"line":104},[80,652,108],{"emptyLinePlaceholder":107},[80,654,655,657,660,662,665,668,670,672],{"class":82,"line":111},[80,656,385],{"class":86},[80,658,659],{"class":114}," myPlugin",[80,661,391],{"class":86},[80,663,664],{"class":90}," (",[80,666,667],{"class":521},"server",[80,669,531],{"class":90},[80,671,201],{"class":86},[80,673,536],{"class":90},[80,675,676,679,682,685,687,689,691,693,695,697],{"class":82,"line":121},[80,677,678],{"class":90},"  server.options.middleware.",[80,680,681],{"class":114},"push",[80,683,684],{"class":90},"((",[80,686,522],{"class":521},[80,688,525],{"class":90},[80,690,528],{"class":521},[80,692,531],{"class":90},[80,694,201],{"class":86},[80,696,580],{"class":114},[80,698,699],{"class":90},"());\n",[80,701,702],{"class":82,"line":128},[80,703,704],{"class":90},"};\n",[80,706,707],{"class":82,"line":141},[80,708,108],{"emptyLinePlaceholder":107},[80,710,711,713],{"class":82,"line":152},[80,712,115],{"class":114},[80,714,118],{"class":90},[80,716,717],{"class":82,"line":157},[80,718,719],{"class":90},"  plugins: [myPlugin],\n",[80,721,722,724,726,728,730,732,734,736],{"class":82,"line":163},[80,723,195],{"class":114},[80,725,198],{"class":90},[80,727,201],{"class":86},[80,729,204],{"class":86},[80,731,207],{"class":114},[80,733,210],{"class":90},[80,735,213],{"class":97},[80,737,216],{"class":90},[80,739,740],{"class":82,"line":169},[80,741,222],{"class":90},[315,743,744],{},[62,745,746,747,750],{},"\nPlugins are sync-only (they return ",[66,748,749],{},"void","). All plugin-registered middleware is therefore in place before the first request is handled.",[242,752,754],{"id":753},"protocol",[66,755,753],{},[62,757,758],{},"The protocol to use for the server.",[62,760,761,762,765,766,259],{},"Possible values are ",[66,763,764],{},"http"," or ",[66,767,768],{},"https",[62,770,771,772,774,775,777,778,780,781,784,785,788],{},"If ",[66,773,753],{}," is not set, Server will use ",[66,776,764],{}," as the default protocol or ",[66,779,768],{}," if both ",[66,782,783],{},"tls.cert"," and ",[66,786,787],{},"tls.key"," options are provided.",[242,790,792],{"id":791},"tls",[66,793,791],{},[62,795,796],{},"TLS server options.",[62,798,799],{},[292,800,801],{},"Example:",[71,803,805],{"className":73,"code":804,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  tls: { cert: \"./server.crt\", key: \"./server.key\" },\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,806,807,819,823,829,846,864],{"__ignoreMap":76},[80,808,809,811,813,815,817],{"class":82,"line":83},[80,810,87],{"class":86},[80,812,91],{"class":90},[80,814,94],{"class":86},[80,816,98],{"class":97},[80,818,101],{"class":90},[80,820,821],{"class":82,"line":104},[80,822,108],{"emptyLinePlaceholder":107},[80,824,825,827],{"class":82,"line":111},[80,826,115],{"class":114},[80,828,118],{"class":90},[80,830,831,834,837,840,843],{"class":82,"line":121},[80,832,833],{"class":90},"  tls: { cert: ",[80,835,836],{"class":97},"\"./server.crt\"",[80,838,839],{"class":90},", key: ",[80,841,842],{"class":97},"\"./server.key\"",[80,844,845],{"class":90}," },\n",[80,847,848,850,852,854,856,858,860,862],{"class":82,"line":128},[80,849,195],{"class":114},[80,851,198],{"class":90},[80,853,201],{"class":86},[80,855,204],{"class":86},[80,857,207],{"class":114},[80,859,210],{"class":90},[80,861,213],{"class":97},[80,863,216],{"class":90},[80,865,866],{"class":82,"line":141},[80,867,222],{"class":90},[62,869,870],{},[292,871,872],{},"Options:",[227,874,875,881,887],{},[230,876,877,880],{},[66,878,879],{},"cert",": Path or inline content for the certificate in PEM format (required).",[230,882,883,886],{},[66,884,885],{},"key",": Path or inline content for the private key in PEM format (required).",[230,888,889,892],{},[66,890,891],{},"passphrase",": Passphrase for the private key (optional).",[261,894,895],{},[62,896,897,898,784,900,902,903,259],{},"\nYou can pass inline ",[66,899,879],{},[66,901,885],{}," values in PEM format starting with ",[66,904,905],{},"-----BEGIN ",[62,907,908,909,259],{},"Client certificates (mutual TLS) are available through the ",[353,910,912,915],{"href":911},"/guide/tls#mutual-tls-mtls",[66,913,914],{},"mtls()"," plugin",[616,917],{"to":38,"title":918},"TLS & mutual TLS",[242,920,922],{"id":921},"onerror",[66,923,924],{},"onError",[62,926,927],{},"Runtime agnostic error handler.",[315,929,930,932],{},[62,931],{},[62,933,934],{},"This handler will take over the built-in error handlers of Deno and Bun.",[62,936,937],{},[292,938,801],{},[71,940,942],{"className":73,"code":941,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  fetch: () => new Response(\"👋 Hello there!\"),\n  onError(error) {\n    return new Response(`\u003Cpre>${error}\\n${error.stack}\u003C/pre>`, {\n      headers: { \"Content-Type\": \"text/html\" },\n    });\n  },\n});\n",[66,943,944,956,960,966,984,997,1035,1051,1056,1061],{"__ignoreMap":76},[80,945,946,948,950,952,954],{"class":82,"line":83},[80,947,87],{"class":86},[80,949,91],{"class":90},[80,951,94],{"class":86},[80,953,98],{"class":97},[80,955,101],{"class":90},[80,957,958],{"class":82,"line":104},[80,959,108],{"emptyLinePlaceholder":107},[80,961,962,964],{"class":82,"line":111},[80,963,115],{"class":114},[80,965,118],{"class":90},[80,967,968,970,972,974,976,978,980,982],{"class":82,"line":121},[80,969,195],{"class":114},[80,971,198],{"class":90},[80,973,201],{"class":86},[80,975,204],{"class":86},[80,977,207],{"class":114},[80,979,210],{"class":90},[80,981,213],{"class":97},[80,983,216],{"class":90},[80,985,986,989,991,994],{"class":82,"line":128},[80,987,988],{"class":114},"  onError",[80,990,210],{"class":90},[80,992,993],{"class":521},"error",[80,995,996],{"class":90},") {\n",[80,998,999,1002,1004,1006,1008,1011,1013,1016,1019,1022,1024,1026,1029,1032],{"class":82,"line":141},[80,1000,1001],{"class":86},"    return",[80,1003,204],{"class":86},[80,1005,207],{"class":114},[80,1007,210],{"class":90},[80,1009,1010],{"class":97},"`\u003Cpre>${",[80,1012,993],{"class":90},[80,1014,1015],{"class":97},"}",[80,1017,1018],{"class":134},"\\n",[80,1020,1021],{"class":97},"${",[80,1023,993],{"class":90},[80,1025,259],{"class":97},[80,1027,1028],{"class":90},"stack",[80,1030,1031],{"class":97},"}\u003C/pre>`",[80,1033,1034],{"class":90},", {\n",[80,1036,1037,1040,1043,1046,1049],{"class":82,"line":152},[80,1038,1039],{"class":90},"      headers: { ",[80,1041,1042],{"class":97},"\"Content-Type\"",[80,1044,1045],{"class":90},": ",[80,1047,1048],{"class":97},"\"text/html\"",[80,1050,845],{"class":90},[80,1052,1053],{"class":82,"line":157},[80,1054,1055],{"class":90},"    });\n",[80,1057,1058],{"class":82,"line":163},[80,1059,1060],{"class":90},"  },\n",[80,1062,1063],{"class":82,"line":169},[80,1064,222],{"class":90},[242,1066,1068],{"id":1067},"maxrequestbodysize",[66,1069,1070],{},"maxRequestBodySize",[62,1072,1073,1074,1077,1078,1081],{},"Maximum allowed size ",[292,1075,1076],{},"in bytes"," for the request body. Defaults to ",[66,1079,1080],{},"undefined"," (no limit).",[62,1083,1084,1085,1088,1089,525,1092,784,1095,1098,1099,1104,1105,1108],{},"As the body is read, its accumulated length is tracked and, once it exceeds the limit, reading is aborted and rejects with a ",[66,1086,1087],{},"413","-style error. The error carries ",[66,1090,1091],{},"statusCode: 413",[66,1093,1094],{},"status: 413",[66,1096,1097],{},"code: \"ERR_BODY_TOO_LARGE\"",", so a handler (or ",[353,1100,1102],{"href":1101},"#onerror",[66,1103,924],{},") can map it to an HTTP ",[66,1106,1107],{},"413 Payload Too Large"," response.",[62,1110,1111,1112,1115,1116,1119,1120,1123,1124,1115,1127,1115,1130,1115,1133,1136],{},"The limit covers both buffered reads (",[66,1113,1114],{},"request.text()"," / ",[66,1117,1118],{},"request.json()",") and the streamed body (",[66,1121,1122],{},"request.body",", and therefore ",[66,1125,1126],{},"request.arrayBuffer()",[66,1128,1129],{},".blob()",[66,1131,1132],{},".bytes()",[66,1134,1135],{},".formData()",").",[62,1138,1139],{},[292,1140,801],{},[71,1142,1144],{"className":73,"code":1143,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  maxRequestBodySize: 1024 * 1024, // 1 MiB\n  fetch: async (request) => {\n    try {\n      return Response.json(await request.json());\n    } catch (error) {\n      if (error.code === \"ERR_BODY_TOO_LARGE\") {\n        return new Response(\"Payload Too Large\", { status: 413 });\n      }\n      throw error;\n    }\n  },\n});\n",[66,1145,1146,1158,1162,1168,1187,1206,1213,1234,1245,1261,1283,1288,1296,1301,1305],{"__ignoreMap":76},[80,1147,1148,1150,1152,1154,1156],{"class":82,"line":83},[80,1149,87],{"class":86},[80,1151,91],{"class":90},[80,1153,94],{"class":86},[80,1155,98],{"class":97},[80,1157,101],{"class":90},[80,1159,1160],{"class":82,"line":104},[80,1161,108],{"emptyLinePlaceholder":107},[80,1163,1164,1166],{"class":82,"line":111},[80,1165,115],{"class":114},[80,1167,118],{"class":90},[80,1169,1170,1173,1176,1179,1182,1184],{"class":82,"line":121},[80,1171,1172],{"class":90},"  maxRequestBodySize: ",[80,1174,1175],{"class":134},"1024",[80,1177,1178],{"class":86}," *",[80,1180,1181],{"class":134}," 1024",[80,1183,525],{"class":90},[80,1185,1186],{"class":124},"// 1 MiB\n",[80,1188,1189,1191,1193,1196,1198,1200,1202,1204],{"class":82,"line":128},[80,1190,195],{"class":114},[80,1192,1045],{"class":90},[80,1194,1195],{"class":86},"async",[80,1197,664],{"class":90},[80,1199,522],{"class":521},[80,1201,531],{"class":90},[80,1203,201],{"class":86},[80,1205,536],{"class":90},[80,1207,1208,1211],{"class":82,"line":141},[80,1209,1210],{"class":86},"    try",[80,1212,536],{"class":90},[80,1214,1215,1217,1220,1223,1225,1227,1230,1232],{"class":82,"line":152},[80,1216,577],{"class":86},[80,1218,1219],{"class":90}," Response.",[80,1221,1222],{"class":114},"json",[80,1224,210],{"class":90},[80,1226,441],{"class":86},[80,1228,1229],{"class":90}," request.",[80,1231,1222],{"class":114},[80,1233,699],{"class":90},[80,1235,1236,1239,1242],{"class":82,"line":157},[80,1237,1238],{"class":90},"    } ",[80,1240,1241],{"class":86},"catch",[80,1243,1244],{"class":90}," (error) {\n",[80,1246,1247,1250,1253,1256,1259],{"class":82,"line":163},[80,1248,1249],{"class":86},"      if",[80,1251,1252],{"class":90}," (error.code ",[80,1254,1255],{"class":86},"===",[80,1257,1258],{"class":97}," \"ERR_BODY_TOO_LARGE\"",[80,1260,996],{"class":90},[80,1262,1263,1266,1268,1270,1272,1275,1278,1280],{"class":82,"line":169},[80,1264,1265],{"class":86},"        return",[80,1267,204],{"class":86},[80,1269,207],{"class":114},[80,1271,210],{"class":90},[80,1273,1274],{"class":97},"\"Payload Too Large\"",[80,1276,1277],{"class":90},", { status: ",[80,1279,1087],{"class":134},[80,1281,1282],{"class":90}," });\n",[80,1284,1285],{"class":82,"line":175},[80,1286,1287],{"class":90},"      }\n",[80,1289,1290,1293],{"class":82,"line":181},[80,1291,1292],{"class":86},"      throw",[80,1294,1295],{"class":90}," error;\n",[80,1297,1298],{"class":82,"line":186},[80,1299,1300],{"class":90},"    }\n",[80,1302,1303],{"class":82,"line":192},[80,1304,1060],{"class":90},[80,1306,1307],{"class":82,"line":219},[80,1308,222],{"class":90},[315,1310,1311,1314],{},[62,1312,1313],{},"\nRuntime support:",[227,1315,1316,1322,1339],{},[230,1317,1318,1321],{},[292,1319,1320],{},"Node",": enforced by srvx (the request body stream is size-limited).",[230,1323,1324,1327,1328,1335,1336,1338],{},[292,1325,1326],{},"Bun",": forwarded to Bun's native ",[353,1329,1333],{"href":1330,"rel":1331},"https://bun.sh/docs/api/http",[1332],"nofollow",[66,1334,1070],{},", enforced by Bun (responds with ",[66,1337,1087],{}," before the handler runs).",[230,1340,1341,1344,1345,1348],{},[292,1342,1343],{},"Deno",": enforced by srvx (",[66,1346,1347],{},"Deno.serve"," has no native option).",[242,1350,1352],{"id":1351},"trustproxy",[66,1353,1354],{},"trustProxy",[62,1356,1357,1358,1361,1362,525,1365,525,1368,1371,1372,1375,1376,784,1379,1382,1383,259],{},"Whether to trust ",[66,1359,1360],{},"X-Forwarded-*"," headers (",[66,1363,1364],{},"X-Forwarded-Proto",[66,1366,1367],{},"X-Forwarded-Host",[66,1369,1370],{},"X-Forwarded-For",", and the HTTP/2 ",[66,1373,1374],{},":scheme",") when deriving ",[66,1377,1378],{},"request.url",[66,1380,1381],{},"request.ip",". Defaults to ",[66,1384,1385],{},"false",[62,1387,1388,1389,525,1392,765,1394,1396,1397,1400],{},"Any client can send ",[66,1390,1391],{},"X-Forwarded-Proto: https",[66,1393,1367],{},[66,1395,1370],{},", so trusting them lets a request masquerade as ",[66,1398,1399],{},"https:",", forge its host, or spoof its client IP. Only enable this when a proxy you control sits in front and overwrites the headers.",[227,1402,1403,1412,1417,1429],{},[230,1404,1405,1407,1408,1411],{},[66,1406,1385],{}," (default): ignore the headers; use the real connection protocol, the on-the-wire ",[66,1409,1410],{},"Host"," header and the socket peer address.",[230,1413,1414,1416],{},[66,1415,346],{},": always trust the headers.",[230,1418,1419,1422,1423,765,1426,1136],{},[66,1420,1421],{},"\"loopback\"",": trust them only when the proxy connects from a loopback address (",[66,1424,1425],{},"127.0.0.0/8",[66,1427,1428],{},"::1",[230,1430,1431,1434],{},[66,1432,1433],{},"string[]",": trust them only when the proxy's address is in the list.",[62,1436,1437],{},[292,1438,801],{},[71,1440,1442],{"className":73,"code":1441,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  // Behind a reverse proxy you control (e.g. Nginx, a load balancer):\n  trustProxy: true,\n  fetch: (request) => new Response(new URL(request.url).protocol),\n});\n",[66,1443,1444,1456,1460,1466,1471,1480,1508],{"__ignoreMap":76},[80,1445,1446,1448,1450,1452,1454],{"class":82,"line":83},[80,1447,87],{"class":86},[80,1449,91],{"class":90},[80,1451,94],{"class":86},[80,1453,98],{"class":97},[80,1455,101],{"class":90},[80,1457,1458],{"class":82,"line":104},[80,1459,108],{"emptyLinePlaceholder":107},[80,1461,1462,1464],{"class":82,"line":111},[80,1463,115],{"class":114},[80,1465,118],{"class":90},[80,1467,1468],{"class":82,"line":121},[80,1469,1470],{"class":124},"  // Behind a reverse proxy you control (e.g. Nginx, a load balancer):\n",[80,1472,1473,1476,1478],{"class":82,"line":128},[80,1474,1475],{"class":90},"  trustProxy: ",[80,1477,346],{"class":134},[80,1479,138],{"class":90},[80,1481,1482,1484,1487,1489,1491,1493,1495,1497,1499,1502,1505],{"class":82,"line":141},[80,1483,195],{"class":114},[80,1485,1486],{"class":90},": (",[80,1488,522],{"class":521},[80,1490,531],{"class":90},[80,1492,201],{"class":86},[80,1494,204],{"class":86},[80,1496,207],{"class":114},[80,1498,210],{"class":90},[80,1500,1501],{"class":86},"new",[80,1503,1504],{"class":114}," URL",[80,1506,1507],{"class":90},"(request.url).protocol),\n",[80,1509,1510],{"class":82,"line":152},[80,1511,222],{"class":90},[315,1513,1514],{},[62,1515,1516],{},"\nApplies to the Node, AWS Lambda, Bun and Deno adapters.",[237,1518,1520],{"id":1519},"runtime-specific-options","Runtime Specific Options",[242,1522,1524],{"id":1523},"nodejs","Node.js",[62,1526,1527],{},[292,1528,801],{},[71,1530,1532],{"className":73,"code":1531,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  node: {\n    maxHeaderSize: 16384 * 2, // Double default\n    ipv6Only: true, // Disable dual-stack support\n    // http2: false // Disable http2 support (enabled by default in TLS mode)\n  },\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,1533,1534,1546,1550,1556,1561,1579,1591,1599,1603,1621],{"__ignoreMap":76},[80,1535,1536,1538,1540,1542,1544],{"class":82,"line":83},[80,1537,87],{"class":86},[80,1539,91],{"class":90},[80,1541,94],{"class":86},[80,1543,98],{"class":97},[80,1545,101],{"class":90},[80,1547,1548],{"class":82,"line":104},[80,1549,108],{"emptyLinePlaceholder":107},[80,1551,1552,1554],{"class":82,"line":111},[80,1553,115],{"class":114},[80,1555,118],{"class":90},[80,1557,1558],{"class":82,"line":121},[80,1559,1560],{"class":90},"  node: {\n",[80,1562,1563,1566,1569,1571,1574,1576],{"class":82,"line":128},[80,1564,1565],{"class":90},"    maxHeaderSize: ",[80,1567,1568],{"class":134},"16384",[80,1570,1178],{"class":86},[80,1572,1573],{"class":134}," 2",[80,1575,525],{"class":90},[80,1577,1578],{"class":124},"// Double default\n",[80,1580,1581,1584,1586,1588],{"class":82,"line":141},[80,1582,1583],{"class":90},"    ipv6Only: ",[80,1585,346],{"class":134},[80,1587,525],{"class":90},[80,1589,1590],{"class":124},"// Disable dual-stack support\n",[80,1592,1593,1596],{"class":82,"line":152},[80,1594,1595],{"class":124},"    // http2: false",[80,1597,1598],{"class":124}," // Disable http2 support (enabled by default in TLS mode)\n",[80,1600,1601],{"class":82,"line":157},[80,1602,1060],{"class":90},[80,1604,1605,1607,1609,1611,1613,1615,1617,1619],{"class":82,"line":163},[80,1606,195],{"class":114},[80,1608,198],{"class":90},[80,1610,201],{"class":86},[80,1612,204],{"class":86},[80,1614,207],{"class":114},[80,1616,210],{"class":90},[80,1618,213],{"class":97},[80,1620,216],{"class":90},[80,1622,1623],{"class":82,"line":169},[80,1624,222],{"class":90},[616,1626,1627],{},[62,1628,1629,1630,784,1635,1640],{},"See Node.js documentation for ",[353,1631,1634],{"href":1632,"rel":1633},"https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener",[1332],"ServerOptions",[353,1636,1639],{"href":1637,"rel":1638},"https://nodejs.org/api/net.html#serverlistenoptions-callback",[1332],"ListenOptions"," for all available options.",[242,1642,1326],{"id":1643},"bun",[62,1645,1646],{},[292,1647,801],{},[71,1649,1651],{"className":73,"code":1650,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  bun: {\n    error(error) {\n      return new Response(`\u003Cpre>${error}\\n${error.stack}\u003C/pre>`, {\n        headers: { \"Content-Type\": \"text/html\" },\n      });\n    },\n  },\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,1652,1653,1665,1669,1675,1680,1691,1721,1734,1739,1743,1747,1765],{"__ignoreMap":76},[80,1654,1655,1657,1659,1661,1663],{"class":82,"line":83},[80,1656,87],{"class":86},[80,1658,91],{"class":90},[80,1660,94],{"class":86},[80,1662,98],{"class":97},[80,1664,101],{"class":90},[80,1666,1667],{"class":82,"line":104},[80,1668,108],{"emptyLinePlaceholder":107},[80,1670,1671,1673],{"class":82,"line":111},[80,1672,115],{"class":114},[80,1674,118],{"class":90},[80,1676,1677],{"class":82,"line":121},[80,1678,1679],{"class":90},"  bun: {\n",[80,1681,1682,1685,1687,1689],{"class":82,"line":128},[80,1683,1684],{"class":114},"    error",[80,1686,210],{"class":90},[80,1688,993],{"class":521},[80,1690,996],{"class":90},[80,1692,1693,1695,1697,1699,1701,1703,1705,1707,1709,1711,1713,1715,1717,1719],{"class":82,"line":141},[80,1694,577],{"class":86},[80,1696,204],{"class":86},[80,1698,207],{"class":114},[80,1700,210],{"class":90},[80,1702,1010],{"class":97},[80,1704,993],{"class":90},[80,1706,1015],{"class":97},[80,1708,1018],{"class":134},[80,1710,1021],{"class":97},[80,1712,993],{"class":90},[80,1714,259],{"class":97},[80,1716,1028],{"class":90},[80,1718,1031],{"class":97},[80,1720,1034],{"class":90},[80,1722,1723,1726,1728,1730,1732],{"class":82,"line":152},[80,1724,1725],{"class":90},"        headers: { ",[80,1727,1042],{"class":97},[80,1729,1045],{"class":90},[80,1731,1048],{"class":97},[80,1733,845],{"class":90},[80,1735,1736],{"class":82,"line":157},[80,1737,1738],{"class":90},"      });\n",[80,1740,1741],{"class":82,"line":163},[80,1742,587],{"class":90},[80,1744,1745],{"class":82,"line":169},[80,1746,1060],{"class":90},[80,1748,1749,1751,1753,1755,1757,1759,1761,1763],{"class":82,"line":175},[80,1750,195],{"class":114},[80,1752,198],{"class":90},[80,1754,201],{"class":86},[80,1756,204],{"class":86},[80,1758,207],{"class":114},[80,1760,210],{"class":90},[80,1762,213],{"class":97},[80,1764,216],{"class":90},[80,1766,1767],{"class":82,"line":181},[80,1768,222],{"class":90},[616,1770,1771],{"to":1330},[62,1772,1773],{},"See Bun HTTP documentation for all available options.",[242,1775,1343],{"id":1776},"deno",[62,1778,1779],{},[292,1780,801],{},[71,1782,1784],{"className":73,"code":1783,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  deno: {\n    onError(error) {\n      return new Response(`\u003Cpre>${error}\\n${error.stack}\u003C/pre>`, {\n        headers: { \"Content-Type\": \"text/html\" },\n      });\n    },\n  },\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,1785,1786,1798,1802,1808,1813,1824,1854,1866,1870,1874,1878,1896],{"__ignoreMap":76},[80,1787,1788,1790,1792,1794,1796],{"class":82,"line":83},[80,1789,87],{"class":86},[80,1791,91],{"class":90},[80,1793,94],{"class":86},[80,1795,98],{"class":97},[80,1797,101],{"class":90},[80,1799,1800],{"class":82,"line":104},[80,1801,108],{"emptyLinePlaceholder":107},[80,1803,1804,1806],{"class":82,"line":111},[80,1805,115],{"class":114},[80,1807,118],{"class":90},[80,1809,1810],{"class":82,"line":121},[80,1811,1812],{"class":90},"  deno: {\n",[80,1814,1815,1818,1820,1822],{"class":82,"line":128},[80,1816,1817],{"class":114},"    onError",[80,1819,210],{"class":90},[80,1821,993],{"class":521},[80,1823,996],{"class":90},[80,1825,1826,1828,1830,1832,1834,1836,1838,1840,1842,1844,1846,1848,1850,1852],{"class":82,"line":141},[80,1827,577],{"class":86},[80,1829,204],{"class":86},[80,1831,207],{"class":114},[80,1833,210],{"class":90},[80,1835,1010],{"class":97},[80,1837,993],{"class":90},[80,1839,1015],{"class":97},[80,1841,1018],{"class":134},[80,1843,1021],{"class":97},[80,1845,993],{"class":90},[80,1847,259],{"class":97},[80,1849,1028],{"class":90},[80,1851,1031],{"class":97},[80,1853,1034],{"class":90},[80,1855,1856,1858,1860,1862,1864],{"class":82,"line":152},[80,1857,1725],{"class":90},[80,1859,1042],{"class":97},[80,1861,1045],{"class":90},[80,1863,1048],{"class":97},[80,1865,845],{"class":90},[80,1867,1868],{"class":82,"line":157},[80,1869,1738],{"class":90},[80,1871,1872],{"class":82,"line":163},[80,1873,587],{"class":90},[80,1875,1876],{"class":82,"line":169},[80,1877,1060],{"class":90},[80,1879,1880,1882,1884,1886,1888,1890,1892,1894],{"class":82,"line":175},[80,1881,195],{"class":114},[80,1883,198],{"class":90},[80,1885,201],{"class":86},[80,1887,204],{"class":86},[80,1889,207],{"class":114},[80,1891,210],{"class":90},[80,1893,213],{"class":97},[80,1895,216],{"class":90},[80,1897,1898],{"class":82,"line":181},[80,1899,222],{"class":90},[616,1901,1903],{"to":1902},"https://docs.deno.com/api/deno/~/Deno.ServeOptions",[62,1904,1905],{},"See Deno serve documentation for all available options.",[242,1907,1909],{"id":1908},"service-worker","Service Worker",[62,1911,1912,1913,1136],{},"Options for the service worker adapter (",[66,1914,1915],{},"srvx/service-worker",[71,1917,1919],{"className":73,"code":1918,"language":75,"meta":76,"style":76},"import { serve } from \"srvx/service-worker\";\n\nserve({\n  serviceWorker: {\n    url: \"/sw.js\", // path to the service worker file to register\n    scope: \"/\", // service worker scope\n  },\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,1920,1921,1934,1938,1944,1949,1962,1975,1979,1997],{"__ignoreMap":76},[80,1922,1923,1925,1927,1929,1932],{"class":82,"line":83},[80,1924,87],{"class":86},[80,1926,91],{"class":90},[80,1928,94],{"class":86},[80,1930,1931],{"class":97}," \"srvx/service-worker\"",[80,1933,101],{"class":90},[80,1935,1936],{"class":82,"line":104},[80,1937,108],{"emptyLinePlaceholder":107},[80,1939,1940,1942],{"class":82,"line":111},[80,1941,115],{"class":114},[80,1943,118],{"class":90},[80,1945,1946],{"class":82,"line":121},[80,1947,1948],{"class":90},"  serviceWorker: {\n",[80,1950,1951,1954,1957,1959],{"class":82,"line":128},[80,1952,1953],{"class":90},"    url: ",[80,1955,1956],{"class":97},"\"/sw.js\"",[80,1958,525],{"class":90},[80,1960,1961],{"class":124},"// path to the service worker file to register\n",[80,1963,1964,1967,1970,1972],{"class":82,"line":141},[80,1965,1966],{"class":90},"    scope: ",[80,1968,1969],{"class":97},"\"/\"",[80,1971,525],{"class":90},[80,1973,1974],{"class":124},"// service worker scope\n",[80,1976,1977],{"class":82,"line":152},[80,1978,1060],{"class":90},[80,1980,1981,1983,1985,1987,1989,1991,1993,1995],{"class":82,"line":157},[80,1982,195],{"class":114},[80,1984,198],{"class":90},[80,1986,201],{"class":86},[80,1988,204],{"class":86},[80,1990,207],{"class":114},[80,1992,210],{"class":90},[80,1994,213],{"class":97},[80,1996,216],{"class":90},[80,1998,1999],{"class":82,"line":163},[80,2000,222],{"class":90},[227,2002,2003,2008],{},[230,2004,2005,2007],{},[66,2006,566],{},": The path to the service worker file to be registered.",[230,2009,2010,2013],{},[66,2011,2012],{},"scope",": The scope of the service worker.",[237,2015,2017],{"id":2016},"per-runtime-support","Per-runtime Support",[62,2019,2020],{},"srvx aims for identical behavior across runtimes, but a few options depend on capabilities the underlying runtime does not expose. The table below lists the intentional differences.",[2022,2023,2024,2037],"table",{},[2025,2026,2027],"thead",{},[2028,2029,2030,2034],"tr",{},[2031,2032,2033],"th",{},"Option / feature",[2031,2035,2036],{},"Behavior",[2038,2039,2040,2061,2074,2090,2099,2109,2131],"tbody",{},[2028,2041,2042,2049],{},[2043,2044,2045,2048],"td",{},[66,2046,2047],{},"close(true)"," (force close)",[2043,2050,2051,2052,2054,2055,2057,2058,259],{},"Honored on Node and Bun. On ",[292,2053,1343],{}," the force argument is currently ignored — ",[66,2056,2047],{}," behaves like a graceful ",[66,2059,2060],{},"close()",[2028,2062,2063,2067],{},[2043,2064,2065],{},[66,2066,1354],{},[2043,2068,2069,2070,2073],{},"Applies to the ",[292,2071,2072],{},"Node, AWS Lambda, Bun and Deno"," adapters only. Ignored on Cloudflare, Bunny and the generic/service-worker adapters.",[2028,2075,2076,2080],{},[2043,2077,2078],{},[66,2079,1070],{},[2043,2081,2082,2083,2085,2086,2089],{},"Node/Deno enforced by srvx (unlimited by default). ",[292,2084,1326],{}," forwards it to Bun's native option, which has its own ",[292,2087,2088],{},"128 MiB"," default even when unset. Dropped (not applied) when running under the CLI loader on any runtime.",[2028,2091,2092,2096],{},[2043,2093,2094],{},[66,2095,338],{},[2043,2097,2098],{},"Meaningless on module-worker runtimes (Cloudflare module syntax, Bunny) — there is no listening step to defer.",[2028,2100,2101,2106],{},[2043,2102,2103],{},[66,2104,2105],{},"gracefulShutdown",[2043,2107,2108],{},"Supported on Node, Deno and Bun. No-op on Cloudflare, Bunny and service-worker runtimes.",[2028,2110,2111,2118],{},[2043,2112,2113,2114,2117],{},"Cloudflare ",[66,2115,2116],{},"env"," bindings",[2043,2119,2120,2123,2124,2127,2128,2130],{},[66,2121,2122],{},"request.runtime.cloudflare.env"," is only populated in ",[292,2125,2126],{},"module-worker syntax",". In service-worker syntax (the global ",[66,2129,68],{}," listener) bindings are unavailable.",[2028,2132,2133,2141],{},[2043,2134,2135],{},[292,2136,2137,2140],{},[66,2138,2139],{},"upgrade"," / WebSocket",[2043,2142,2143,2144,2146,2147,2149,2150,2153,2154,2156,2157,2162],{},"srvx does ",[292,2145,350],{}," handle HTTP ",[66,2148,2139],{}," requests on ",[292,2151,2152],{},"any"," runtime — WebSocket upgrades never reach your ",[66,2155,68],{}," handler. Use ",[353,2158,2161],{"href":2159,"rel":2160},"https://crossws.h3.dev/",[1332],"crossws"," for WebSocket support.",[242,2164,2166],{"id":2165},"deno-version","Deno version",[62,2168,2169,2170,2173],{},"srvx targets ",[292,2171,2172],{},"Deno 2.x"," (CI runs against Deno 2.7.x).",[297,2175,2176],{},[62,2177,2178,2179,2182,2183,2185,2186,259],{},"\nUnder the Bunny runtime, a root ",[66,2180,2181],{},"srvx"," import resolves the ",[66,2184,1776],{}," export condition (Bunny is Deno-based) and would give you the Deno adapter. Always import the Bunny adapter explicitly via ",[66,2187,2188],{},"srvx/bunny",[237,2190,2192],{"id":2191},"public-subpaths","Public Subpaths",[62,2194,2195,2196,2198],{},"In addition to the main ",[66,2197,2181],{}," entry and the runtime adapters, srvx exposes several public subpaths:",[2022,2200,2201,2214],{},[2025,2202,2203],{},[2028,2204,2205,2208,2211],{},[2031,2206,2207],{},"Subpath",[2031,2209,2210],{},"Exports",[2031,2212,2213],{},"Use when",[2038,2215,2216,2243,2258,2274,2293,2320],{},[2028,2217,2218,2223,2229],{},[2043,2219,2220],{},[66,2221,2222],{},"srvx/static",[2043,2224,2225,2228],{},[66,2226,2227],{},"serveStatic"," middleware",[2043,2230,2231,2232,2235,2236,1115,2239,2242],{},"Serving static files. ",[292,2233,2234],{},"Node-API-only"," (uses ",[66,2237,2238],{},"node:fs",[66,2240,2241],{},"node:zlib",") despite the neutral name — works only on runtimes with Node compatibility.",[2028,2244,2245,2250,2255],{},[2043,2246,2247],{},[66,2248,2249],{},"srvx/log",[2043,2251,2252,2228],{},[66,2253,2254],{},"log()",[2043,2256,2257],{},"Adding request logging (used by the CLI).",[2028,2259,2260,2265,2271],{},[2043,2261,2262],{},[66,2263,2264],{},"srvx/loader",[2043,2266,2267,2270],{},[66,2268,2269],{},"loadServerEntry",", related types",[2043,2272,2273],{},"Resolving and loading a server entry file (as the CLI does).",[2028,2275,2276,2281,2290],{},[2043,2277,2278],{},[66,2279,2280],{},"srvx/cli",[2043,2282,2283,525,2286,2289],{},[66,2284,2285],{},"main",[66,2287,2288],{},"cliFetch",", CLI types",[2043,2291,2292],{},"Building a custom CLI on top of srvx.",[2028,2294,2295,2300,2310],{},[2043,2296,2297],{},[66,2298,2299],{},"srvx/generic",[2043,2301,2302,525,2304,525,2307],{},[66,2303,115],{},[66,2305,2306],{},"FastURL",[66,2308,2309],{},"FastResponse",[2043,2311,2312,2313,2315,2316,2319],{},"A web-standard (",[66,2314,68],{},"/",[66,2317,2318],{},"Response",") runtime with no dedicated adapter.",[2028,2321,2322,2326,2334],{},[2043,2323,2324],{},[66,2325,1915],{},[2043,2327,2328,525,2330,525,2332],{},[66,2329,115],{},[66,2331,2306],{},[66,2333,2309],{},[2043,2335,2336],{},"Running inside a browser/service-worker environment.",[237,2338,2340],{"id":2339},"typescript-types","TypeScript Types",[62,2342,2343,2344,2346,2347,525,2350,525,2353,525,2356,2359,2360,2363],{},"Runtime-specific option and context types are typed against each runtime's own type packages, which srvx does ",[292,2345,350],{}," bundle. To get full typing for ",[66,2348,2349],{},"options.bun",[66,2351,2352],{},"options.deno",[66,2354,2355],{},"request.runtime.cloudflare",[66,2357,2358],{},"request.runtime.awsLambda"," (and similar), install the relevant ",[66,2361,2362],{},"devDependencies"," in your project:",[227,2365,2366,2385,2401,2415],{},[230,2367,2368,664,2370,2372,2373,2380,2381,2384],{},[292,2369,1326],{},[66,2371,2349],{},"): ",[353,2374,2377],{"href":2375,"rel":2376},"https://www.npmjs.com/package/@types/bun",[1332],[66,2378,2379],{},"@types/bun"," (or ",[66,2382,2383],{},"bun-types",")",[230,2386,2387,664,2389,525,2391,2372,2394],{},[292,2388,1343],{},[66,2390,2352],{},[66,2392,2393],{},"request.runtime.deno",[353,2395,2398],{"href":2396,"rel":2397},"https://www.npmjs.com/package/@types/deno",[1332],[66,2399,2400],{},"@types/deno",[230,2402,2403,664,2406,2372,2408],{},[292,2404,2405],{},"Cloudflare",[66,2407,2355],{},[353,2409,2412],{"href":2410,"rel":2411},"https://www.npmjs.com/package/@cloudflare/workers-types",[1332],[66,2413,2414],{},"@cloudflare/workers-types",[230,2416,2417,664,2419,2372,2421],{},[292,2418,52],{},[66,2420,2358],{},[353,2422,2425],{"href":2423,"rel":2424},"https://www.npmjs.com/package/@types/aws-lambda",[1332],[66,2426,2427],{},"@types/aws-lambda",[62,2429,2430,2431,2433,2434,2437],{},"Without these, the corresponding fields fall back to ",[66,2432,2152],{}," (with ",[66,2435,2436],{},"skipLibCheck",") or raise type errors (without it).",[2439,2440,2441],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}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 .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}",{"title":76,"searchDepth":104,"depth":104,"links":2443},[2444,2458,2464,2467,2468],{"id":239,"depth":104,"text":240,"children":2445},[2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457],{"id":244,"depth":111,"text":244},{"id":272,"depth":111,"text":272},{"id":307,"depth":111,"text":310},{"id":326,"depth":111,"text":326},{"id":338,"depth":111,"text":338},{"id":470,"depth":111,"text":470},{"id":620,"depth":111,"text":620},{"id":753,"depth":111,"text":753},{"id":791,"depth":111,"text":791},{"id":921,"depth":111,"text":924},{"id":1067,"depth":111,"text":1070},{"id":1351,"depth":111,"text":1354},{"id":1519,"depth":104,"text":1520,"children":2459},[2460,2461,2462,2463],{"id":1523,"depth":111,"text":1524},{"id":1643,"depth":111,"text":1326},{"id":1776,"depth":111,"text":1343},{"id":1908,"depth":111,"text":1909},{"id":2016,"depth":104,"text":2017,"children":2465},[2466],{"id":2165,"depth":111,"text":2166},{"id":2191,"depth":104,"text":2192},{"id":2339,"depth":104,"text":2340},"Provide additional options to customize listening server.","md",{"icon":35},{"icon":35},{"title":32,"description":2469},"oXWuomVup5O2dAaLpPz85nsVmThnNJdxzGBw28XAGro",[2476,2478],{"title":27,"path":28,"stem":29,"description":2477,"icon":30,"children":-1},"Plugins and middleware allow adding reusable server extensions.",{"title":37,"path":38,"stem":39,"description":2479,"icon":40,"children":-1},"Serve over HTTPS and, optionally, require a client certificate (mutual TLS).",1784034230534]