[{"data":1,"prerenderedAt":1527},["ShallowReactive",2],{"navigation":3,"-guide-options":56,"-guide-options-surround":1522},[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":1516,"extension":1517,"meta":1518,"navigation":1519,"path":33,"seo":1520,"stem":34,"__hash__":1521},"content/1.guide/5.options.md",{"type":59,"value":60,"toc":1498,"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,502,505,512,516,643,649,660,688,716,720,895,935,941,972,987,1022,1026,1099,1104,1108,1112,1116,1212,1228,1231,1235,1357,1362,1365,1369,1488,1494],[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},"onerror",[66,500,501],{},"onError",[62,503,504],{},"Runtime agnostic error handler.",[305,506,507,509],{},[62,508],{},[62,510,511],{},"This handler will take over the built-in error handlers of Deno and Bun.",[62,513,514],{},[282,515,376],{},[71,517,519],{"className":73,"code":518,"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,520,521,533,537,543,561,575,613,629,634,639],{"__ignoreMap":76},[80,522,523,525,527,529,531],{"class":82,"line":83},[80,524,87],{"class":86},[80,526,91],{"class":90},[80,528,94],{"class":86},[80,530,98],{"class":97},[80,532,101],{"class":90},[80,534,535],{"class":82,"line":104},[80,536,108],{"emptyLinePlaceholder":107},[80,538,539,541],{"class":82,"line":111},[80,540,115],{"class":114},[80,542,118],{"class":90},[80,544,545,547,549,551,553,555,557,559],{"class":82,"line":121},[80,546,195],{"class":114},[80,548,198],{"class":90},[80,550,201],{"class":86},[80,552,204],{"class":86},[80,554,207],{"class":114},[80,556,210],{"class":90},[80,558,213],{"class":97},[80,560,216],{"class":90},[80,562,563,566,568,572],{"class":82,"line":128},[80,564,565],{"class":114},"  onError",[80,567,210],{"class":90},[80,569,571],{"class":570},"sQHwn","error",[80,573,574],{"class":90},") {\n",[80,576,577,580,582,584,586,589,591,594,597,600,602,604,607,610],{"class":82,"line":141},[80,578,579],{"class":86},"    return",[80,581,204],{"class":86},[80,583,207],{"class":114},[80,585,210],{"class":90},[80,587,588],{"class":97},"`\u003Cpre>${",[80,590,571],{"class":90},[80,592,593],{"class":97},"}",[80,595,596],{"class":134},"\\n",[80,598,599],{"class":97},"${",[80,601,571],{"class":90},[80,603,259],{"class":97},[80,605,606],{"class":90},"stack",[80,608,609],{"class":97},"}\u003C/pre>`",[80,611,612],{"class":90},", {\n",[80,614,615,618,621,624,627],{"class":82,"line":152},[80,616,617],{"class":90},"      headers: { ",[80,619,620],{"class":97},"\"Content-Type\"",[80,622,623],{"class":90},": ",[80,625,626],{"class":97},"\"text/html\"",[80,628,420],{"class":90},[80,630,631],{"class":82,"line":157},[80,632,633],{"class":90},"    });\n",[80,635,636],{"class":82,"line":163},[80,637,638],{"class":90},"  },\n",[80,640,641],{"class":82,"line":169},[80,642,222],{"class":90},[242,644,646],{"id":645},"maxrequestbodysize",[66,647,648],{},"maxRequestBodySize",[62,650,651,652,655,656,659],{},"Maximum allowed size ",[282,653,654],{},"in bytes"," for the request body. Defaults to ",[66,657,658],{},"undefined"," (no limit).",[62,661,662,663,666,667,670,671,359,674,677,678,683,684,687],{},"As the body is read, its accumulated length is tracked and, once it exceeds the limit, reading is aborted and rejects with a ",[66,664,665],{},"413","-style error. The error carries ",[66,668,669],{},"statusCode: 413",", ",[66,672,673],{},"status: 413",[66,675,676],{},"code: \"ERR_BODY_TOO_LARGE\"",", so a handler (or ",[485,679,681],{"href":680},"#onerror",[66,682,501],{},") can map it to an HTTP ",[66,685,686],{},"413 Payload Too Large"," response.",[62,689,690,691,694,695,698,699,702,703,694,706,694,709,694,712,715],{},"The limit covers both buffered reads (",[66,692,693],{},"request.text()"," / ",[66,696,697],{},"request.json()",") and the streamed body (",[66,700,701],{},"request.body",", and therefore ",[66,704,705],{},"request.arrayBuffer()",[66,707,708],{},".blob()",[66,710,711],{},".bytes()",[66,713,714],{},".formData()",").",[62,717,718],{},[282,719,376],{},[71,721,723],{"className":73,"code":722,"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,724,725,737,741,747,766,789,796,820,831,847,869,874,882,887,891],{"__ignoreMap":76},[80,726,727,729,731,733,735],{"class":82,"line":83},[80,728,87],{"class":86},[80,730,91],{"class":90},[80,732,94],{"class":86},[80,734,98],{"class":97},[80,736,101],{"class":90},[80,738,739],{"class":82,"line":104},[80,740,108],{"emptyLinePlaceholder":107},[80,742,743,745],{"class":82,"line":111},[80,744,115],{"class":114},[80,746,118],{"class":90},[80,748,749,752,755,758,761,763],{"class":82,"line":121},[80,750,751],{"class":90},"  maxRequestBodySize: ",[80,753,754],{"class":134},"1024",[80,756,757],{"class":86}," *",[80,759,760],{"class":134}," 1024",[80,762,670],{"class":90},[80,764,765],{"class":124},"// 1 MiB\n",[80,767,768,770,772,775,778,781,784,786],{"class":82,"line":128},[80,769,195],{"class":114},[80,771,623],{"class":90},[80,773,774],{"class":86},"async",[80,776,777],{"class":90}," (",[80,779,780],{"class":570},"request",[80,782,783],{"class":90},") ",[80,785,201],{"class":86},[80,787,788],{"class":90}," {\n",[80,790,791,794],{"class":82,"line":141},[80,792,793],{"class":86},"    try",[80,795,788],{"class":90},[80,797,798,801,804,807,809,812,815,817],{"class":82,"line":152},[80,799,800],{"class":86},"      return",[80,802,803],{"class":90}," Response.",[80,805,806],{"class":114},"json",[80,808,210],{"class":90},[80,810,811],{"class":86},"await",[80,813,814],{"class":90}," request.",[80,816,806],{"class":114},[80,818,819],{"class":90},"());\n",[80,821,822,825,828],{"class":82,"line":157},[80,823,824],{"class":90},"    } ",[80,826,827],{"class":86},"catch",[80,829,830],{"class":90}," (error) {\n",[80,832,833,836,839,842,845],{"class":82,"line":163},[80,834,835],{"class":86},"      if",[80,837,838],{"class":90}," (error.code ",[80,840,841],{"class":86},"===",[80,843,844],{"class":97}," \"ERR_BODY_TOO_LARGE\"",[80,846,574],{"class":90},[80,848,849,852,854,856,858,861,864,866],{"class":82,"line":169},[80,850,851],{"class":86},"        return",[80,853,204],{"class":86},[80,855,207],{"class":114},[80,857,210],{"class":90},[80,859,860],{"class":97},"\"Payload Too Large\"",[80,862,863],{"class":90},", { status: ",[80,865,665],{"class":134},[80,867,868],{"class":90}," });\n",[80,870,871],{"class":82,"line":175},[80,872,873],{"class":90},"      }\n",[80,875,876,879],{"class":82,"line":181},[80,877,878],{"class":86},"      throw",[80,880,881],{"class":90}," error;\n",[80,883,884],{"class":82,"line":186},[80,885,886],{"class":90},"    }\n",[80,888,889],{"class":82,"line":192},[80,890,638],{"class":90},[80,892,893],{"class":82,"line":219},[80,894,222],{"class":90},[305,896,897,900],{},[62,898,899],{},"\nRuntime support:",[227,901,902,908,925],{},[230,903,904,907],{},[282,905,906],{},"Node",": enforced by srvx (the request body stream is size-limited).",[230,909,910,913,914,921,922,924],{},[282,911,912],{},"Bun",": forwarded to Bun's native ",[485,915,919],{"href":916,"rel":917},"https://bun.sh/docs/api/http",[918],"nofollow",[66,920,648],{},", enforced by Bun (responds with ",[66,923,665],{}," before the handler runs).",[230,926,927,930,931,934],{},[282,928,929],{},"Deno",": enforced by srvx (",[66,932,933],{},"Deno.serve"," has no native option).",[242,936,938],{"id":937},"trustproxy",[66,939,940],{},"trustProxy",[62,942,943,944,947,948,670,951,670,954,957,958,961,962,359,965,968,969,259],{},"Whether to trust ",[66,945,946],{},"X-Forwarded-*"," headers (",[66,949,950],{},"X-Forwarded-Proto",[66,952,953],{},"X-Forwarded-Host",[66,955,956],{},"X-Forwarded-For",", and the HTTP/2 ",[66,959,960],{},":scheme",") when deriving ",[66,963,964],{},"request.url",[66,966,967],{},"request.ip",". Defaults to ",[66,970,971],{},"false",[62,973,974,975,670,978,340,980,982,983,986],{},"Any client can send ",[66,976,977],{},"X-Forwarded-Proto: https",[66,979,953],{},[66,981,956],{},", so trusting them lets a request masquerade as ",[66,984,985],{},"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,988,989,998,1004,1016],{},[230,990,991,993,994,997],{},[66,992,971],{}," (default): ignore the headers; use the real connection protocol, the on-the-wire ",[66,995,996],{},"Host"," header and the socket peer address.",[230,999,1000,1003],{},[66,1001,1002],{},"true",": always trust the headers.",[230,1005,1006,1009,1010,340,1013,715],{},[66,1007,1008],{},"\"loopback\"",": trust them only when the proxy connects from a loopback address (",[66,1011,1012],{},"127.0.0.0/8",[66,1014,1015],{},"::1",[230,1017,1018,1021],{},[66,1019,1020],{},"string[]",": trust them only when the proxy's address is in the list.",[62,1023,1024],{},[282,1025,376],{},[71,1027,1029],{"className":73,"code":1028,"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,1030,1031,1043,1047,1053,1058,1067,1095],{"__ignoreMap":76},[80,1032,1033,1035,1037,1039,1041],{"class":82,"line":83},[80,1034,87],{"class":86},[80,1036,91],{"class":90},[80,1038,94],{"class":86},[80,1040,98],{"class":97},[80,1042,101],{"class":90},[80,1044,1045],{"class":82,"line":104},[80,1046,108],{"emptyLinePlaceholder":107},[80,1048,1049,1051],{"class":82,"line":111},[80,1050,115],{"class":114},[80,1052,118],{"class":90},[80,1054,1055],{"class":82,"line":121},[80,1056,1057],{"class":124},"  // Behind a reverse proxy you control (e.g. Nginx, a load balancer):\n",[80,1059,1060,1063,1065],{"class":82,"line":128},[80,1061,1062],{"class":90},"  trustProxy: ",[80,1064,1002],{"class":134},[80,1066,138],{"class":90},[80,1068,1069,1071,1074,1076,1078,1080,1082,1084,1086,1089,1092],{"class":82,"line":141},[80,1070,195],{"class":114},[80,1072,1073],{"class":90},": (",[80,1075,780],{"class":570},[80,1077,783],{"class":90},[80,1079,201],{"class":86},[80,1081,204],{"class":86},[80,1083,207],{"class":114},[80,1085,210],{"class":90},[80,1087,1088],{"class":86},"new",[80,1090,1091],{"class":114}," URL",[80,1093,1094],{"class":90},"(request.url).protocol),\n",[80,1096,1097],{"class":82,"line":152},[80,1098,222],{"class":90},[305,1100,1101],{},[62,1102,1103],{},"\nApplies to the Node, AWS Lambda, Bun and Deno adapters.",[237,1105,1107],{"id":1106},"runtime-specific-options","Runtime Specific Options",[242,1109,1111],{"id":1110},"nodejs","Node.js",[62,1113,1114],{},[282,1115,376],{},[71,1117,1119],{"className":73,"code":1118,"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,1120,1121,1133,1137,1143,1148,1166,1178,1186,1190,1208],{"__ignoreMap":76},[80,1122,1123,1125,1127,1129,1131],{"class":82,"line":83},[80,1124,87],{"class":86},[80,1126,91],{"class":90},[80,1128,94],{"class":86},[80,1130,98],{"class":97},[80,1132,101],{"class":90},[80,1134,1135],{"class":82,"line":104},[80,1136,108],{"emptyLinePlaceholder":107},[80,1138,1139,1141],{"class":82,"line":111},[80,1140,115],{"class":114},[80,1142,118],{"class":90},[80,1144,1145],{"class":82,"line":121},[80,1146,1147],{"class":90},"  node: {\n",[80,1149,1150,1153,1156,1158,1161,1163],{"class":82,"line":128},[80,1151,1152],{"class":90},"    maxHeadersize: ",[80,1154,1155],{"class":134},"16384",[80,1157,757],{"class":86},[80,1159,1160],{"class":134}," 2",[80,1162,670],{"class":90},[80,1164,1165],{"class":124},"// Double default\n",[80,1167,1168,1171,1173,1175],{"class":82,"line":141},[80,1169,1170],{"class":90},"    ipv6Only: ",[80,1172,1002],{"class":134},[80,1174,670],{"class":90},[80,1176,1177],{"class":124},"// Disable dual-stack support\n",[80,1179,1180,1183],{"class":82,"line":152},[80,1181,1182],{"class":124},"    // http2: false",[80,1184,1185],{"class":124}," // Disable http2 support (enabled by default in TLS mode)\n",[80,1187,1188],{"class":82,"line":157},[80,1189,638],{"class":90},[80,1191,1192,1194,1196,1198,1200,1202,1204,1206],{"class":82,"line":163},[80,1193,195],{"class":114},[80,1195,198],{"class":90},[80,1197,201],{"class":86},[80,1199,204],{"class":86},[80,1201,207],{"class":114},[80,1203,210],{"class":90},[80,1205,213],{"class":97},[80,1207,216],{"class":90},[80,1209,1210],{"class":82,"line":169},[80,1211,222],{"class":90},[493,1213,1214],{},[62,1215,1216,1217,359,1222,1227],{},"See Node.js documentation for ",[485,1218,1221],{"href":1219,"rel":1220},"https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener",[918],"ServerOptions",[485,1223,1226],{"href":1224,"rel":1225},"https://nodejs.org/api/net.html#serverlistenoptions-callback",[918],"ListenOptions"," for all available options.",[242,1229,912],{"id":1230},"bun",[62,1232,1233],{},[282,1234,376],{},[71,1236,1238],{"className":73,"code":1237,"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,1239,1240,1252,1256,1262,1267,1278,1308,1321,1326,1331,1335,1353],{"__ignoreMap":76},[80,1241,1242,1244,1246,1248,1250],{"class":82,"line":83},[80,1243,87],{"class":86},[80,1245,91],{"class":90},[80,1247,94],{"class":86},[80,1249,98],{"class":97},[80,1251,101],{"class":90},[80,1253,1254],{"class":82,"line":104},[80,1255,108],{"emptyLinePlaceholder":107},[80,1257,1258,1260],{"class":82,"line":111},[80,1259,115],{"class":114},[80,1261,118],{"class":90},[80,1263,1264],{"class":82,"line":121},[80,1265,1266],{"class":90},"  bun: {\n",[80,1268,1269,1272,1274,1276],{"class":82,"line":128},[80,1270,1271],{"class":114},"    error",[80,1273,210],{"class":90},[80,1275,571],{"class":570},[80,1277,574],{"class":90},[80,1279,1280,1282,1284,1286,1288,1290,1292,1294,1296,1298,1300,1302,1304,1306],{"class":82,"line":141},[80,1281,800],{"class":86},[80,1283,204],{"class":86},[80,1285,207],{"class":114},[80,1287,210],{"class":90},[80,1289,588],{"class":97},[80,1291,571],{"class":90},[80,1293,593],{"class":97},[80,1295,596],{"class":134},[80,1297,599],{"class":97},[80,1299,571],{"class":90},[80,1301,259],{"class":97},[80,1303,606],{"class":90},[80,1305,609],{"class":97},[80,1307,612],{"class":90},[80,1309,1310,1313,1315,1317,1319],{"class":82,"line":152},[80,1311,1312],{"class":90},"        headers: { ",[80,1314,620],{"class":97},[80,1316,623],{"class":90},[80,1318,626],{"class":97},[80,1320,420],{"class":90},[80,1322,1323],{"class":82,"line":157},[80,1324,1325],{"class":90},"      });\n",[80,1327,1328],{"class":82,"line":163},[80,1329,1330],{"class":90},"    },\n",[80,1332,1333],{"class":82,"line":169},[80,1334,638],{"class":90},[80,1336,1337,1339,1341,1343,1345,1347,1349,1351],{"class":82,"line":175},[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":181},[80,1356,222],{"class":90},[493,1358,1359],{"to":916},[62,1360,1361],{},"See Bun HTTP documentation for all available options.",[242,1363,929],{"id":1364},"deno",[62,1366,1367],{},[282,1368,376],{},[71,1370,1372],{"className":73,"code":1371,"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,1373,1374,1386,1390,1396,1401,1412,1442,1454,1458,1462,1466,1484],{"__ignoreMap":76},[80,1375,1376,1378,1380,1382,1384],{"class":82,"line":83},[80,1377,87],{"class":86},[80,1379,91],{"class":90},[80,1381,94],{"class":86},[80,1383,98],{"class":97},[80,1385,101],{"class":90},[80,1387,1388],{"class":82,"line":104},[80,1389,108],{"emptyLinePlaceholder":107},[80,1391,1392,1394],{"class":82,"line":111},[80,1393,115],{"class":114},[80,1395,118],{"class":90},[80,1397,1398],{"class":82,"line":121},[80,1399,1400],{"class":90},"  deno: {\n",[80,1402,1403,1406,1408,1410],{"class":82,"line":128},[80,1404,1405],{"class":114},"    onError",[80,1407,210],{"class":90},[80,1409,571],{"class":570},[80,1411,574],{"class":90},[80,1413,1414,1416,1418,1420,1422,1424,1426,1428,1430,1432,1434,1436,1438,1440],{"class":82,"line":141},[80,1415,800],{"class":86},[80,1417,204],{"class":86},[80,1419,207],{"class":114},[80,1421,210],{"class":90},[80,1423,588],{"class":97},[80,1425,571],{"class":90},[80,1427,593],{"class":97},[80,1429,596],{"class":134},[80,1431,599],{"class":97},[80,1433,571],{"class":90},[80,1435,259],{"class":97},[80,1437,606],{"class":90},[80,1439,609],{"class":97},[80,1441,612],{"class":90},[80,1443,1444,1446,1448,1450,1452],{"class":82,"line":152},[80,1445,1312],{"class":90},[80,1447,620],{"class":97},[80,1449,623],{"class":90},[80,1451,626],{"class":97},[80,1453,420],{"class":90},[80,1455,1456],{"class":82,"line":157},[80,1457,1325],{"class":90},[80,1459,1460],{"class":82,"line":163},[80,1461,1330],{"class":90},[80,1463,1464],{"class":82,"line":169},[80,1465,638],{"class":90},[80,1467,1468,1470,1472,1474,1476,1478,1480,1482],{"class":82,"line":175},[80,1469,195],{"class":114},[80,1471,198],{"class":90},[80,1473,201],{"class":86},[80,1475,204],{"class":86},[80,1477,207],{"class":114},[80,1479,210],{"class":90},[80,1481,213],{"class":97},[80,1483,216],{"class":90},[80,1485,1486],{"class":82,"line":181},[80,1487,222],{"class":90},[493,1489,1491],{"to":1490},"https://docs.deno.com/api/deno/~/Deno.ServeOptions",[62,1492,1493],{},"See Deno serve documentation for all available options.",[1495,1496,1497],"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":1499},[1500,1511],{"id":239,"depth":104,"text":240,"children":1501},[1502,1503,1504,1505,1506,1507,1508,1509,1510],{"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":501},{"id":645,"depth":111,"text":648},{"id":937,"depth":111,"text":940},{"id":1106,"depth":104,"text":1107,"children":1512},[1513,1514,1515],{"id":1110,"depth":111,"text":1111},{"id":1230,"depth":111,"text":912},{"id":1364,"depth":111,"text":929},"Provide additional options to customize listening server.","md",{"icon":35},{"icon":35},{"title":32,"description":1516},"9vx7DXEwDgEt98KvwxFQI35DZXsaVDzyT21FnVgH3dU",[1523,1525],{"title":27,"path":28,"stem":29,"description":1524,"icon":30,"children":-1},"Plugins and middleware allow adding reusable server extensions.",{"title":37,"path":38,"stem":39,"description":1526,"icon":40,"children":-1},"Serve over HTTPS and, optionally, require a client certificate (mutual TLS).",1784030713104]