[{"data":1,"prerenderedAt":1673},["ShallowReactive",2],{"navigation":3,"-guide-options":56,"-guide-options-surround":1668},[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":1662,"extension":1663,"meta":1664,"navigation":1665,"path":33,"seo":1666,"stem":34,"__hash__":1667},"content/1.guide/5.options.md",{"type":59,"value":60,"toc":1643,"icon":35},"minimark",[61,70,223,226,236,241,247,250,260,270,275,278,286,295,301,304,314,319,326,331,334,344,364,369,372,377,443,448,468,481,492,496,501,511,518,522,648,654,665,693,721,725,900,940,946,977,992,1027,1031,1104,1109,1115,1125,1132,1160,1182,1186,1249,1253,1257,1261,1357,1373,1376,1380,1502,1507,1510,1514,1633,1639],[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,285],{},"When not provided, server will ",[282,283,284],"strong",{},"listen to all network interfaces"," by default.",[287,288,289],"important",{},[62,290,291,292,259],{},"\nIf you are running a server that should not be exposed to the network, use ",[66,293,294],{},"localhost",[242,296,298],{"id":297},"reuseport",[66,299,300],{},"reusePort",[62,302,303],{},"Enabling this option allows multiple processes to bind to the same port, which is useful for load balancing.",[305,306,307],"note",{},[62,308,309,310,313],{},"\nDespite Node.js built-in behavior that has ",[66,311,312],{},"exclusive"," flag enabled by default, srvx uses non-exclusive mode for consistency.",[242,315,317],{"id":316},"silent",[66,318,316],{},[62,320,321,322,325],{},"If enabled, no server listening message will be printed (enabled by default when ",[66,323,324],{},"TEST"," environment variable is set).",[242,327,329],{"id":328},"protocol",[66,330,328],{},[62,332,333],{},"The protocol to use for the server.",[62,335,336,337,340,341,259],{},"Possible values are ",[66,338,339],{},"http"," or ",[66,342,343],{},"https",[62,345,346,347,349,350,352,353,355,356,359,360,363],{},"If ",[66,348,328],{}," is not set, Server will use ",[66,351,339],{}," as the default protocol or ",[66,354,343],{}," if both ",[66,357,358],{},"tls.cert"," and ",[66,361,362],{},"tls.key"," options are provided.",[242,365,367],{"id":366},"tls",[66,368,366],{},[62,370,371],{},"TLS server options.",[62,373,374],{},[282,375,376],{},"Example:",[71,378,380],{"className":73,"code":379,"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,381,382,394,398,404,421,439],{"__ignoreMap":76},[80,383,384,386,388,390,392],{"class":82,"line":83},[80,385,87],{"class":86},[80,387,91],{"class":90},[80,389,94],{"class":86},[80,391,98],{"class":97},[80,393,101],{"class":90},[80,395,396],{"class":82,"line":104},[80,397,108],{"emptyLinePlaceholder":107},[80,399,400,402],{"class":82,"line":111},[80,401,115],{"class":114},[80,403,118],{"class":90},[80,405,406,409,412,415,418],{"class":82,"line":121},[80,407,408],{"class":90},"  tls: { cert: ",[80,410,411],{"class":97},"\"./server.crt\"",[80,413,414],{"class":90},", key: ",[80,416,417],{"class":97},"\"./server.key\"",[80,419,420],{"class":90}," },\n",[80,422,423,425,427,429,431,433,435,437],{"class":82,"line":128},[80,424,195],{"class":114},[80,426,198],{"class":90},[80,428,201],{"class":86},[80,430,204],{"class":86},[80,432,207],{"class":114},[80,434,210],{"class":90},[80,436,213],{"class":97},[80,438,216],{"class":90},[80,440,441],{"class":82,"line":141},[80,442,222],{"class":90},[62,444,445],{},[282,446,447],{},"Options:",[227,449,450,456,462],{},[230,451,452,455],{},[66,453,454],{},"cert",": Path or inline content for the certificate in PEM format (required).",[230,457,458,461],{},[66,459,460],{},"key",": Path or inline content for the private key in PEM format (required).",[230,463,464,467],{},[66,465,466],{},"passphrase",": Passphrase for the private key (optional).",[261,469,470],{},[62,471,472,473,359,475,477,478,259],{},"\nYou can pass inline ",[66,474,454],{},[66,476,460],{}," values in PEM format starting with ",[66,479,480],{},"-----BEGIN ",[62,482,483,484,259],{},"Client certificates (mutual TLS) are available through the ",[485,486,488,491],"a",{"href":487},"/guide/tls#mutual-tls-mtls",[66,489,490],{},"mtls()"," plugin",[493,494],"read-more",{"to":38,"title":495},"TLS & mutual TLS",[242,497,499],{"id":498},"error",[66,500,498],{},[62,502,503,504,506,507,510],{},"Runtime agnostic error handler. It runs whenever the ",[66,505,68],{}," handler (or any middleware) throws or rejects, and returns the ",[66,508,509],{},"Response"," to send instead.",[305,512,513,515],{},[62,514],{},[62,516,517],{},"This handler will also take over the built-in error handlers of Deno and Bun.",[62,519,520],{},[282,521,376],{},[71,523,525],{"className":73,"code":524,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  fetch: () => new Response(\"👋 Hello there!\"),\n  error(error) {\n    return new Response(`\u003Cpre>${error}\\n${error.stack}\u003C/pre>`, {\n      headers: { \"Content-Type\": \"text/html\" },\n    });\n  },\n});\n",[66,526,527,539,543,549,567,580,618,634,639,644],{"__ignoreMap":76},[80,528,529,531,533,535,537],{"class":82,"line":83},[80,530,87],{"class":86},[80,532,91],{"class":90},[80,534,94],{"class":86},[80,536,98],{"class":97},[80,538,101],{"class":90},[80,540,541],{"class":82,"line":104},[80,542,108],{"emptyLinePlaceholder":107},[80,544,545,547],{"class":82,"line":111},[80,546,115],{"class":114},[80,548,118],{"class":90},[80,550,551,553,555,557,559,561,563,565],{"class":82,"line":121},[80,552,195],{"class":114},[80,554,198],{"class":90},[80,556,201],{"class":86},[80,558,204],{"class":86},[80,560,207],{"class":114},[80,562,210],{"class":90},[80,564,213],{"class":97},[80,566,216],{"class":90},[80,568,569,572,574,577],{"class":82,"line":128},[80,570,571],{"class":114},"  error",[80,573,210],{"class":90},[80,575,498],{"class":576},"sQHwn",[80,578,579],{"class":90},") {\n",[80,581,582,585,587,589,591,594,596,599,602,605,607,609,612,615],{"class":82,"line":141},[80,583,584],{"class":86},"    return",[80,586,204],{"class":86},[80,588,207],{"class":114},[80,590,210],{"class":90},[80,592,593],{"class":97},"`\u003Cpre>${",[80,595,498],{"class":90},[80,597,598],{"class":97},"}",[80,600,601],{"class":134},"\\n",[80,603,604],{"class":97},"${",[80,606,498],{"class":90},[80,608,259],{"class":97},[80,610,611],{"class":90},"stack",[80,613,614],{"class":97},"}\u003C/pre>`",[80,616,617],{"class":90},", {\n",[80,619,620,623,626,629,632],{"class":82,"line":152},[80,621,622],{"class":90},"      headers: { ",[80,624,625],{"class":97},"\"Content-Type\"",[80,627,628],{"class":90},": ",[80,630,631],{"class":97},"\"text/html\"",[80,633,420],{"class":90},[80,635,636],{"class":82,"line":157},[80,637,638],{"class":90},"    });\n",[80,640,641],{"class":82,"line":163},[80,642,643],{"class":90},"  },\n",[80,645,646],{"class":82,"line":169},[80,647,222],{"class":90},[242,649,651],{"id":650},"maxrequestbodysize",[66,652,653],{},"maxRequestBodySize",[62,655,656,657,660,661,664],{},"Maximum allowed size ",[282,658,659],{},"in bytes"," for the request body. Defaults to ",[66,662,663],{},"undefined"," (no limit).",[62,666,667,668,671,672,675,676,359,679,682,683,688,689,692],{},"As the body is read, its accumulated length is tracked and, once it exceeds the limit, reading is aborted and rejects with a ",[66,669,670],{},"413","-style error. The error carries ",[66,673,674],{},"statusCode: 413",", ",[66,677,678],{},"status: 413",[66,680,681],{},"code: \"ERR_BODY_TOO_LARGE\"",", so a handler (or ",[485,684,686],{"href":685},"#error",[66,687,498],{},") can map it to an HTTP ",[66,690,691],{},"413 Payload Too Large"," response.",[62,694,695,696,699,700,703,704,707,708,699,711,699,714,699,717,720],{},"The limit covers both buffered reads (",[66,697,698],{},"request.text()"," / ",[66,701,702],{},"request.json()",") and the streamed body (",[66,705,706],{},"request.body",", and therefore ",[66,709,710],{},"request.arrayBuffer()",[66,712,713],{},".blob()",[66,715,716],{},".bytes()",[66,718,719],{},".formData()",").",[62,722,723],{},[282,724,376],{},[71,726,728],{"className":73,"code":727,"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,729,730,742,746,752,771,794,801,825,836,852,874,879,887,892,896],{"__ignoreMap":76},[80,731,732,734,736,738,740],{"class":82,"line":83},[80,733,87],{"class":86},[80,735,91],{"class":90},[80,737,94],{"class":86},[80,739,98],{"class":97},[80,741,101],{"class":90},[80,743,744],{"class":82,"line":104},[80,745,108],{"emptyLinePlaceholder":107},[80,747,748,750],{"class":82,"line":111},[80,749,115],{"class":114},[80,751,118],{"class":90},[80,753,754,757,760,763,766,768],{"class":82,"line":121},[80,755,756],{"class":90},"  maxRequestBodySize: ",[80,758,759],{"class":134},"1024",[80,761,762],{"class":86}," *",[80,764,765],{"class":134}," 1024",[80,767,675],{"class":90},[80,769,770],{"class":124},"// 1 MiB\n",[80,772,773,775,777,780,783,786,789,791],{"class":82,"line":128},[80,774,195],{"class":114},[80,776,628],{"class":90},[80,778,779],{"class":86},"async",[80,781,782],{"class":90}," (",[80,784,785],{"class":576},"request",[80,787,788],{"class":90},") ",[80,790,201],{"class":86},[80,792,793],{"class":90}," {\n",[80,795,796,799],{"class":82,"line":141},[80,797,798],{"class":86},"    try",[80,800,793],{"class":90},[80,802,803,806,809,812,814,817,820,822],{"class":82,"line":152},[80,804,805],{"class":86},"      return",[80,807,808],{"class":90}," Response.",[80,810,811],{"class":114},"json",[80,813,210],{"class":90},[80,815,816],{"class":86},"await",[80,818,819],{"class":90}," request.",[80,821,811],{"class":114},[80,823,824],{"class":90},"());\n",[80,826,827,830,833],{"class":82,"line":157},[80,828,829],{"class":90},"    } ",[80,831,832],{"class":86},"catch",[80,834,835],{"class":90}," (error) {\n",[80,837,838,841,844,847,850],{"class":82,"line":163},[80,839,840],{"class":86},"      if",[80,842,843],{"class":90}," (error.code ",[80,845,846],{"class":86},"===",[80,848,849],{"class":97}," \"ERR_BODY_TOO_LARGE\"",[80,851,579],{"class":90},[80,853,854,857,859,861,863,866,869,871],{"class":82,"line":169},[80,855,856],{"class":86},"        return",[80,858,204],{"class":86},[80,860,207],{"class":114},[80,862,210],{"class":90},[80,864,865],{"class":97},"\"Payload Too Large\"",[80,867,868],{"class":90},", { status: ",[80,870,670],{"class":134},[80,872,873],{"class":90}," });\n",[80,875,876],{"class":82,"line":175},[80,877,878],{"class":90},"      }\n",[80,880,881,884],{"class":82,"line":181},[80,882,883],{"class":86},"      throw",[80,885,886],{"class":90}," error;\n",[80,888,889],{"class":82,"line":186},[80,890,891],{"class":90},"    }\n",[80,893,894],{"class":82,"line":192},[80,895,643],{"class":90},[80,897,898],{"class":82,"line":219},[80,899,222],{"class":90},[305,901,902,905],{},[62,903,904],{},"\nRuntime support:",[227,906,907,913,930],{},[230,908,909,912],{},[282,910,911],{},"Node",": enforced by srvx (the request body stream is size-limited).",[230,914,915,918,919,926,927,929],{},[282,916,917],{},"Bun",": forwarded to Bun's native ",[485,920,924],{"href":921,"rel":922},"https://bun.sh/docs/api/http",[923],"nofollow",[66,925,653],{},", enforced by Bun (responds with ",[66,928,670],{}," before the handler runs).",[230,931,932,935,936,939],{},[282,933,934],{},"Deno",": enforced by srvx (",[66,937,938],{},"Deno.serve"," has no native option).",[242,941,943],{"id":942},"trustproxy",[66,944,945],{},"trustProxy",[62,947,948,949,952,953,675,956,675,959,962,963,966,967,359,970,973,974,259],{},"Whether to trust ",[66,950,951],{},"X-Forwarded-*"," headers (",[66,954,955],{},"X-Forwarded-Proto",[66,957,958],{},"X-Forwarded-Host",[66,960,961],{},"X-Forwarded-For",", and the HTTP/2 ",[66,964,965],{},":scheme",") when deriving ",[66,968,969],{},"request.url",[66,971,972],{},"request.ip",". Defaults to ",[66,975,976],{},"false",[62,978,979,980,675,983,340,985,987,988,991],{},"Any client can send ",[66,981,982],{},"X-Forwarded-Proto: https",[66,984,958],{},[66,986,961],{},", so trusting them lets a request masquerade as ",[66,989,990],{},"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,993,994,1003,1009,1021],{},[230,995,996,998,999,1002],{},[66,997,976],{}," (default): ignore the headers; use the real connection protocol, the on-the-wire ",[66,1000,1001],{},"Host"," header and the socket peer address.",[230,1004,1005,1008],{},[66,1006,1007],{},"true",": always trust the headers.",[230,1010,1011,1014,1015,340,1018,720],{},[66,1012,1013],{},"\"loopback\"",": trust them only when the proxy connects from a loopback address (",[66,1016,1017],{},"127.0.0.0/8",[66,1019,1020],{},"::1",[230,1022,1023,1026],{},[66,1024,1025],{},"string[]",": trust them only when the proxy's address is in the list.",[62,1028,1029],{},[282,1030,376],{},[71,1032,1034],{"className":73,"code":1033,"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,1035,1036,1048,1052,1058,1063,1072,1100],{"__ignoreMap":76},[80,1037,1038,1040,1042,1044,1046],{"class":82,"line":83},[80,1039,87],{"class":86},[80,1041,91],{"class":90},[80,1043,94],{"class":86},[80,1045,98],{"class":97},[80,1047,101],{"class":90},[80,1049,1050],{"class":82,"line":104},[80,1051,108],{"emptyLinePlaceholder":107},[80,1053,1054,1056],{"class":82,"line":111},[80,1055,115],{"class":114},[80,1057,118],{"class":90},[80,1059,1060],{"class":82,"line":121},[80,1061,1062],{"class":124},"  // Behind a reverse proxy you control (e.g. Nginx, a load balancer):\n",[80,1064,1065,1068,1070],{"class":82,"line":128},[80,1066,1067],{"class":90},"  trustProxy: ",[80,1069,1007],{"class":134},[80,1071,138],{"class":90},[80,1073,1074,1076,1079,1081,1083,1085,1087,1089,1091,1094,1097],{"class":82,"line":141},[80,1075,195],{"class":114},[80,1077,1078],{"class":90},": (",[80,1080,785],{"class":576},[80,1082,788],{"class":90},[80,1084,201],{"class":86},[80,1086,204],{"class":86},[80,1088,207],{"class":114},[80,1090,210],{"class":90},[80,1092,1093],{"class":86},"new",[80,1095,1096],{"class":114}," URL",[80,1098,1099],{"class":90},"(request.url).protocol),\n",[80,1101,1102],{"class":82,"line":152},[80,1103,222],{"class":90},[305,1105,1106],{},[62,1107,1108],{},"\nApplies to the Node, AWS Lambda, Bun and Deno adapters.",[242,1110,1112],{"id":1111},"gracefulshutdown",[66,1113,1114],{},"gracefulShutdown",[62,1116,1117,1118,359,1121,1124],{},"Graceful shutdown on ",[66,1119,1120],{},"SIGINT",[66,1122,1123],{},"SIGTERM"," signals (supported for the Node.js, Deno and Bun runtimes).",[62,1126,1127,1128,1131],{},"When enabled, the server stops accepting new connections and waits for in-flight requests to finish before exiting. Pressing ",[66,1129,1130],{},"Ctrl+C"," a second time forces an immediate close.",[227,1133,1134,1149,1154],{},[230,1135,1136,1138,1139,1142,1143,340,1146,1148],{},[66,1137,1007],{}," (default): enable graceful shutdown. It is ",[282,1140,1141],{},"disabled by default"," when the ",[66,1144,1145],{},"CI",[66,1147,324],{}," environment variable is set.",[230,1150,1151,1153],{},[66,1152,976],{},": disable graceful shutdown.",[230,1155,1156,1159],{},[66,1157,1158],{},"{ gracefulTimeout?: number }",": enable and customize the timeout.",[62,1161,1162,1163,1166,1167,1170,1171,1174,1175,1178,1179,1181],{},"The ",[66,1164,1165],{},"gracefulTimeout"," is the number of ",[282,1168,1169],{},"seconds"," to wait for in-flight requests before forcing a close. It defaults to ",[66,1172,1173],{},"5"," seconds and can also be set via the ",[66,1176,1177],{},"SERVER_SHUTDOWN_TIMEOUT"," environment variable. Set it to ",[66,1180,268],{}," to force close immediately once shutdown starts.",[62,1183,1184],{},[282,1185,376],{},[71,1187,1189],{"className":73,"code":1188,"language":75,"meta":76,"style":76},"import { serve } from \"srvx\";\n\nserve({\n  gracefulShutdown: { gracefulTimeout: 10 }, // seconds\n  fetch: () => new Response(\"👋 Hello there!\"),\n});\n",[66,1190,1191,1203,1207,1213,1227,1245],{"__ignoreMap":76},[80,1192,1193,1195,1197,1199,1201],{"class":82,"line":83},[80,1194,87],{"class":86},[80,1196,91],{"class":90},[80,1198,94],{"class":86},[80,1200,98],{"class":97},[80,1202,101],{"class":90},[80,1204,1205],{"class":82,"line":104},[80,1206,108],{"emptyLinePlaceholder":107},[80,1208,1209,1211],{"class":82,"line":111},[80,1210,115],{"class":114},[80,1212,118],{"class":90},[80,1214,1215,1218,1221,1224],{"class":82,"line":121},[80,1216,1217],{"class":90},"  gracefulShutdown: { gracefulTimeout: ",[80,1219,1220],{"class":134},"10",[80,1222,1223],{"class":90}," }, ",[80,1225,1226],{"class":124},"// seconds\n",[80,1228,1229,1231,1233,1235,1237,1239,1241,1243],{"class":82,"line":128},[80,1230,195],{"class":114},[80,1232,198],{"class":90},[80,1234,201],{"class":86},[80,1236,204],{"class":86},[80,1238,207],{"class":114},[80,1240,210],{"class":90},[80,1242,213],{"class":97},[80,1244,216],{"class":90},[80,1246,1247],{"class":82,"line":141},[80,1248,222],{"class":90},[237,1250,1252],{"id":1251},"runtime-specific-options","Runtime Specific Options",[242,1254,1256],{"id":1255},"nodejs","Node.js",[62,1258,1259],{},[282,1260,376],{},[71,1262,1264],{"className":73,"code":1263,"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,1265,1266,1278,1282,1288,1293,1311,1323,1331,1335,1353],{"__ignoreMap":76},[80,1267,1268,1270,1272,1274,1276],{"class":82,"line":83},[80,1269,87],{"class":86},[80,1271,91],{"class":90},[80,1273,94],{"class":86},[80,1275,98],{"class":97},[80,1277,101],{"class":90},[80,1279,1280],{"class":82,"line":104},[80,1281,108],{"emptyLinePlaceholder":107},[80,1283,1284,1286],{"class":82,"line":111},[80,1285,115],{"class":114},[80,1287,118],{"class":90},[80,1289,1290],{"class":82,"line":121},[80,1291,1292],{"class":90},"  node: {\n",[80,1294,1295,1298,1301,1303,1306,1308],{"class":82,"line":128},[80,1296,1297],{"class":90},"    maxHeadersize: ",[80,1299,1300],{"class":134},"16384",[80,1302,762],{"class":86},[80,1304,1305],{"class":134}," 2",[80,1307,675],{"class":90},[80,1309,1310],{"class":124},"// Double default\n",[80,1312,1313,1316,1318,1320],{"class":82,"line":141},[80,1314,1315],{"class":90},"    ipv6Only: ",[80,1317,1007],{"class":134},[80,1319,675],{"class":90},[80,1321,1322],{"class":124},"// Disable dual-stack support\n",[80,1324,1325,1328],{"class":82,"line":152},[80,1326,1327],{"class":124},"    // http2: false",[80,1329,1330],{"class":124}," // Disable http2 support (enabled by default in TLS mode)\n",[80,1332,1333],{"class":82,"line":157},[80,1334,643],{"class":90},[80,1336,1337,1339,1341,1343,1345,1347,1349,1351],{"class":82,"line":163},[80,1338,195],{"class":114},[80,1340,198],{"class":90},[80,1342,201],{"class":86},[80,1344,204],{"class":86},[80,1346,207],{"class":114},[80,1348,210],{"class":90},[80,1350,213],{"class":97},[80,1352,216],{"class":90},[80,1354,1355],{"class":82,"line":169},[80,1356,222],{"class":90},[493,1358,1359],{},[62,1360,1361,1362,359,1367,1372],{},"See Node.js documentation for ",[485,1363,1366],{"href":1364,"rel":1365},"https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener",[923],"ServerOptions",[485,1368,1371],{"href":1369,"rel":1370},"https://nodejs.org/api/net.html#serverlistenoptions-callback",[923],"ListenOptions"," for all available options.",[242,1374,917],{"id":1375},"bun",[62,1377,1378],{},[282,1379,376],{},[71,1381,1383],{"className":73,"code":1382,"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,1384,1385,1397,1401,1407,1412,1423,1453,1466,1471,1476,1480,1498],{"__ignoreMap":76},[80,1386,1387,1389,1391,1393,1395],{"class":82,"line":83},[80,1388,87],{"class":86},[80,1390,91],{"class":90},[80,1392,94],{"class":86},[80,1394,98],{"class":97},[80,1396,101],{"class":90},[80,1398,1399],{"class":82,"line":104},[80,1400,108],{"emptyLinePlaceholder":107},[80,1402,1403,1405],{"class":82,"line":111},[80,1404,115],{"class":114},[80,1406,118],{"class":90},[80,1408,1409],{"class":82,"line":121},[80,1410,1411],{"class":90},"  bun: {\n",[80,1413,1414,1417,1419,1421],{"class":82,"line":128},[80,1415,1416],{"class":114},"    error",[80,1418,210],{"class":90},[80,1420,498],{"class":576},[80,1422,579],{"class":90},[80,1424,1425,1427,1429,1431,1433,1435,1437,1439,1441,1443,1445,1447,1449,1451],{"class":82,"line":141},[80,1426,805],{"class":86},[80,1428,204],{"class":86},[80,1430,207],{"class":114},[80,1432,210],{"class":90},[80,1434,593],{"class":97},[80,1436,498],{"class":90},[80,1438,598],{"class":97},[80,1440,601],{"class":134},[80,1442,604],{"class":97},[80,1444,498],{"class":90},[80,1446,259],{"class":97},[80,1448,611],{"class":90},[80,1450,614],{"class":97},[80,1452,617],{"class":90},[80,1454,1455,1458,1460,1462,1464],{"class":82,"line":152},[80,1456,1457],{"class":90},"        headers: { ",[80,1459,625],{"class":97},[80,1461,628],{"class":90},[80,1463,631],{"class":97},[80,1465,420],{"class":90},[80,1467,1468],{"class":82,"line":157},[80,1469,1470],{"class":90},"      });\n",[80,1472,1473],{"class":82,"line":163},[80,1474,1475],{"class":90},"    },\n",[80,1477,1478],{"class":82,"line":169},[80,1479,643],{"class":90},[80,1481,1482,1484,1486,1488,1490,1492,1494,1496],{"class":82,"line":175},[80,1483,195],{"class":114},[80,1485,198],{"class":90},[80,1487,201],{"class":86},[80,1489,204],{"class":86},[80,1491,207],{"class":114},[80,1493,210],{"class":90},[80,1495,213],{"class":97},[80,1497,216],{"class":90},[80,1499,1500],{"class":82,"line":181},[80,1501,222],{"class":90},[493,1503,1504],{"to":921},[62,1505,1506],{},"See Bun HTTP documentation for all available options.",[242,1508,934],{"id":1509},"deno",[62,1511,1512],{},[282,1513,376],{},[71,1515,1517],{"className":73,"code":1516,"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,1518,1519,1531,1535,1541,1546,1557,1587,1599,1603,1607,1611,1629],{"__ignoreMap":76},[80,1520,1521,1523,1525,1527,1529],{"class":82,"line":83},[80,1522,87],{"class":86},[80,1524,91],{"class":90},[80,1526,94],{"class":86},[80,1528,98],{"class":97},[80,1530,101],{"class":90},[80,1532,1533],{"class":82,"line":104},[80,1534,108],{"emptyLinePlaceholder":107},[80,1536,1537,1539],{"class":82,"line":111},[80,1538,115],{"class":114},[80,1540,118],{"class":90},[80,1542,1543],{"class":82,"line":121},[80,1544,1545],{"class":90},"  deno: {\n",[80,1547,1548,1551,1553,1555],{"class":82,"line":128},[80,1549,1550],{"class":114},"    onError",[80,1552,210],{"class":90},[80,1554,498],{"class":576},[80,1556,579],{"class":90},[80,1558,1559,1561,1563,1565,1567,1569,1571,1573,1575,1577,1579,1581,1583,1585],{"class":82,"line":141},[80,1560,805],{"class":86},[80,1562,204],{"class":86},[80,1564,207],{"class":114},[80,1566,210],{"class":90},[80,1568,593],{"class":97},[80,1570,498],{"class":90},[80,1572,598],{"class":97},[80,1574,601],{"class":134},[80,1576,604],{"class":97},[80,1578,498],{"class":90},[80,1580,259],{"class":97},[80,1582,611],{"class":90},[80,1584,614],{"class":97},[80,1586,617],{"class":90},[80,1588,1589,1591,1593,1595,1597],{"class":82,"line":152},[80,1590,1457],{"class":90},[80,1592,625],{"class":97},[80,1594,628],{"class":90},[80,1596,631],{"class":97},[80,1598,420],{"class":90},[80,1600,1601],{"class":82,"line":157},[80,1602,1470],{"class":90},[80,1604,1605],{"class":82,"line":163},[80,1606,1475],{"class":90},[80,1608,1609],{"class":82,"line":169},[80,1610,643],{"class":90},[80,1612,1613,1615,1617,1619,1621,1623,1625,1627],{"class":82,"line":175},[80,1614,195],{"class":114},[80,1616,198],{"class":90},[80,1618,201],{"class":86},[80,1620,204],{"class":86},[80,1622,207],{"class":114},[80,1624,210],{"class":90},[80,1626,213],{"class":97},[80,1628,216],{"class":90},[80,1630,1631],{"class":82,"line":181},[80,1632,222],{"class":90},[493,1634,1636],{"to":1635},"https://docs.deno.com/api/deno/~/Deno.ServeOptions",[62,1637,1638],{},"See Deno serve documentation for all available options.",[1640,1641,1642],"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":1644},[1645,1657],{"id":239,"depth":104,"text":240,"children":1646},[1647,1648,1649,1650,1651,1652,1653,1654,1655,1656],{"id":244,"depth":111,"text":244},{"id":272,"depth":111,"text":272},{"id":297,"depth":111,"text":300},{"id":316,"depth":111,"text":316},{"id":328,"depth":111,"text":328},{"id":366,"depth":111,"text":366},{"id":498,"depth":111,"text":498},{"id":650,"depth":111,"text":653},{"id":942,"depth":111,"text":945},{"id":1111,"depth":111,"text":1114},{"id":1251,"depth":104,"text":1252,"children":1658},[1659,1660,1661],{"id":1255,"depth":111,"text":1256},{"id":1375,"depth":111,"text":917},{"id":1509,"depth":111,"text":934},"Provide additional options to customize listening server.","md",{"icon":35},{"icon":35},{"title":32,"description":1662},"Rqxa0SgvsnkIqY76W14KCK4bq6Hsi81Tvb5Zf3lQh40",[1669,1671],{"title":27,"path":28,"stem":29,"description":1670,"icon":30,"children":-1},"Plugins and middleware allow adding reusable server extensions.",{"title":37,"path":38,"stem":39,"description":1672,"icon":40,"children":-1},"Serve over HTTPS and, optionally, require a client certificate (mutual TLS).",1784028577690]