[{"data":1,"prerenderedAt":842},["ShallowReactive",2],{"navigation_docs":3,"-platforms-aws-lambda":195,"-platforms-aws-lambda-surround":837},[4,27,61,75,100,126,147,177],{"title":5,"icon":6,"redirect":7,"path":8,"stem":9,"children":10,"page":26},"Introduction","icon-park-outline:home","\u002Fintroduction\u002Fabout-mion","\u002Fintroduction","1.introduction",[11,14,18,22],{"title":12,"path":7,"stem":13},"About mion","1.introduction\u002F1.about-mion",{"title":15,"path":16,"stem":17},"Quick Start","\u002Fintroduction\u002Fquick-start","1.introduction\u002F2.quick-start",{"title":19,"path":20,"stem":21},"Manual Install","\u002Fintroduction\u002Fmanual-install","1.introduction\u002F3.manual-install",{"title":23,"path":24,"stem":25},"What's Next","\u002Fintroduction\u002Fwhat-is-next","1.introduction\u002F4.what-is-next",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Server","icon-park-outline:server","\u002Fserver","20.server",[33,37,41,45,49,53,57],{"title":34,"path":35,"stem":36},"Router Overview","\u002Fserver\u002Foverview","20.server\u002F0.overview",{"title":38,"path":39,"stem":40},"Routes","\u002Fserver\u002Froutes","20.server\u002F1.routes",{"title":42,"path":43,"stem":44},"Middleware","\u002Fserver\u002Fmiddle-fns","20.server\u002F2.middle-fns",{"title":46,"path":47,"stem":48},"Request & Response","\u002Fserver\u002Frequest-and-response","20.server\u002F5.request-and-response",{"title":50,"path":51,"stem":52},"Error Handling","\u002Fserver\u002Ferror-handling","20.server\u002F6.error-handling",{"title":54,"path":55,"stem":56},"Validation","\u002Fserver\u002Fvalidation","20.server\u002F7.validation",{"title":58,"path":59,"stem":60},"Serialization","\u002Fserver\u002Fserialization","20.server\u002F8.serialization",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":26},"Drizzle ORM","i-lineicons-drizzle","\u002Fdrizzle-orm","21.drizzle-orm",[67,71],{"title":68,"path":69,"stem":70},"Drizzle Overview","\u002Fdrizzle-orm\u002Fdrizzle-overview","21.drizzle-orm\u002F0.drizzle-overview",{"title":72,"path":73,"stem":74},"Column Mapping","\u002Fdrizzle-orm\u002Fcolumn-mapping","21.drizzle-orm\u002F1.column-mapping",{"title":76,"icon":77,"path":78,"stem":79,"children":80,"page":26},"Client","icon-park-outline:computer","\u002Fclient","3.client",[81,85,88,92,96],{"title":82,"path":83,"stem":84},"Client Overview","\u002Fclient\u002Fclient-overview","3.client\u002F0.client-overview",{"title":50,"path":86,"stem":87},"\u002Fclient\u002Ferror-handling","3.client\u002F1.error-handling",{"title":89,"path":90,"stem":91},"Validation Errors","\u002Fclient\u002Fvalidation-errors","3.client\u002F2.validation-errors",{"title":93,"path":94,"stem":95},"Routes Flow","\u002Fclient\u002Fclient-flow","3.client\u002F3.client-flow",{"title":97,"path":98,"stem":99},"Cancellation & Timeouts","\u002Fclient\u002Fcancellation-timeouts","3.client\u002F4.cancellation-timeouts",{"title":101,"icon":102,"redirect":103,"path":104,"stem":105,"children":106,"page":26},"RunTypes","i-lucide-scan-text","\u002Frun-types\u002Foverview","\u002Frun-types","4.run-types",[107,110,114,118,122],{"title":108,"path":103,"stem":109},"RunTypes Overview","4.run-types\u002F0.overview",{"title":111,"path":112,"stem":113},"Supported Types","\u002Frun-types\u002Ffeatures","4.run-types\u002F1.features",{"title":115,"path":116,"stem":117},"Type Formats","\u002Frun-types\u002Ftype-formats","4.run-types\u002F2.type-formats",{"title":119,"path":120,"stem":121},"Built-in Formats","\u002Frun-types\u002Fbuilt-in-formats","4.run-types\u002F3.built-in-formats",{"title":123,"path":124,"stem":125},"Caveats","\u002Frun-types\u002Fcaveats","4.run-types\u002F4.caveats",{"title":127,"path":128,"stem":129,"children":130,"page":26},"Devtools","\u002Fdevtools","5.devtools",[131,135,139,143],{"title":132,"path":133,"stem":134},"AOT Compilation","\u002Fdevtools\u002Faot-compilation","5.devtools\u002F0.aot-compilation",{"title":136,"path":137,"stem":138},"Pure Functions","\u002Fdevtools\u002Fpure-functions","5.devtools\u002F1.pure-functions",{"title":140,"path":141,"stem":142},"ESLint Rules","\u002Fdevtools\u002Feslint-rules","5.devtools\u002F2.eslint-rules",{"title":144,"path":145,"stem":146},"Vite Configuration","\u002Fdevtools\u002Fvite-config","5.devtools\u002F3.vite-config",{"title":148,"redirect":149,"icon":150,"path":151,"stem":152,"children":153,"page":26},"Platforms","\u002Fplatforms\u002Fnode-js","icon-park-outline:play","\u002Fplatforms","6.platforms",[154,157,161,165,169,173],{"title":155,"path":149,"stem":156},"Node.js","6.platforms\u002F1.node-js",{"title":158,"path":159,"stem":160},"Bun","\u002Fplatforms\u002Fbun","6.platforms\u002F2.bun",{"title":162,"path":163,"stem":164},"AWS Lambda","\u002Fplatforms\u002Faws-lambda","6.platforms\u002F3.aws-lambda",{"title":166,"path":167,"stem":168},"Google Cloud Functions","\u002Fplatforms\u002Fgoogle-cloud-functions","6.platforms\u002F4.google-cloud-functions",{"title":170,"path":171,"stem":172},"Cloudflare Workers","\u002Fplatforms\u002Fcloudflare","6.platforms\u002F5.cloudflare",{"title":174,"path":175,"stem":176},"Vercel","\u002Fplatforms\u002Fvercel","6.platforms\u002F6.vercel",{"title":178,"icon":179,"redirect":180,"path":181,"stem":182,"children":183,"page":26},"Benchmarks","icon-park-outline:chart-line","\u002Fbenchmarks\u002Fhello-world","\u002Fbenchmarks","7.benchmarks",[184,187,191],{"title":185,"path":180,"stem":186},"Hello World","7.benchmarks\u002F1.hello-world",{"title":188,"path":189,"stem":190},"Light Validation","\u002Fbenchmarks\u002Flight-validation","7.benchmarks\u002F2.light-validation",{"title":192,"path":193,"stem":194},"Heavy Validation","\u002Fbenchmarks\u002Fheavy-validation","7.benchmarks\u002F3.heavy-validation",{"id":196,"title":162,"body":197,"description":831,"extension":832,"links":833,"meta":834,"navigation":338,"path":163,"seo":835,"stem":164,"__hash__":836},"docs\u002F6.platforms\u002F3.aws-lambda.md",{"type":198,"value":199},"minimark",[200,209,214,242,245,524,528,531,616,620,626,761,765,768,772,777,827],[201,202,203,204,208],"p",{},"mion can run on AWS Lambda for serverless deployments. The ",[205,206,207],"code",{},"@mionjs\u002Fplatform-aws"," package provides a handler compatible with API Gateway events.",[210,211,213],"h2",{"id":212},"installation","Installation",[215,216,221],"pre",{"className":217,"code":218,"language":219,"meta":220,"style":220},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm install @mionjs\u002Fplatform-aws @mionjs\u002Frouter\n","bash","",[205,222,223],{"__ignoreMap":220},[224,225,228,232,236,239],"span",{"class":226,"line":227},"line",1,[224,229,231],{"class":230},"sBMFI","npm",[224,233,235],{"class":234},"sfazB"," install",[224,237,238],{"class":234}," @mionjs\u002Fplatform-aws",[224,240,241],{"class":234}," @mionjs\u002Frouter\n",[210,243,15],{"id":244},"quick-start",[246,247,248,384],"code-group",{},[215,249,254],{"className":250,"code":251,"filename":252,"language":253,"meta":220,"style":220},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {createAwsLambdaHandler} from '@mionjs\u002Fplatform-aws';\nimport {initMionRouter} from '@mionjs\u002Frouter';\nimport {routes} from '.\u002Faws-routes.ts';\n\nawait initMionRouter(routes);\n\nexport const handler = createAwsLambdaHandler();\n","src\u002Fhandler.ts","ts",[205,255,256,287,310,333,340,355,360],{"__ignoreMap":220},[224,257,258,262,266,270,273,276,279,281,284],{"class":226,"line":227},[224,259,261],{"class":260},"s7zQu","import",[224,263,265],{"class":264},"sMK4o"," {",[224,267,269],{"class":268},"sTEyZ","createAwsLambdaHandler",[224,271,272],{"class":264},"}",[224,274,275],{"class":260}," from",[224,277,278],{"class":264}," '",[224,280,207],{"class":234},[224,282,283],{"class":264},"'",[224,285,286],{"class":264},";\n",[224,288,290,292,294,297,299,301,303,306,308],{"class":226,"line":289},2,[224,291,261],{"class":260},[224,293,265],{"class":264},[224,295,296],{"class":268},"initMionRouter",[224,298,272],{"class":264},[224,300,275],{"class":260},[224,302,278],{"class":264},[224,304,305],{"class":234},"@mionjs\u002Frouter",[224,307,283],{"class":264},[224,309,286],{"class":264},[224,311,313,315,317,320,322,324,326,329,331],{"class":226,"line":312},3,[224,314,261],{"class":260},[224,316,265],{"class":264},[224,318,319],{"class":268},"routes",[224,321,272],{"class":264},[224,323,275],{"class":260},[224,325,278],{"class":264},[224,327,328],{"class":234},".\u002Faws-routes.ts",[224,330,283],{"class":264},[224,332,286],{"class":264},[224,334,336],{"class":226,"line":335},4,[224,337,339],{"emptyLinePlaceholder":338},true,"\n",[224,341,343,346,350,353],{"class":226,"line":342},5,[224,344,345],{"class":260},"await",[224,347,349],{"class":348},"s2Zo4"," initMionRouter",[224,351,352],{"class":268},"(routes)",[224,354,286],{"class":264},[224,356,358],{"class":226,"line":357},6,[224,359,339],{"emptyLinePlaceholder":338},[224,361,363,366,370,373,376,379,382],{"class":226,"line":362},7,[224,364,365],{"class":260},"export",[224,367,369],{"class":368},"spNyl"," const",[224,371,372],{"class":268}," handler ",[224,374,375],{"class":264},"=",[224,377,378],{"class":348}," createAwsLambdaHandler",[224,380,381],{"class":268},"()",[224,383,286],{"class":264},[215,385,388],{"className":250,"code":386,"filename":387,"language":253,"meta":220,"style":220},"import {Routes, route} from '@mionjs\u002Frouter';\n\nexport const routes = {\n    sayHello: route((ctx, name: string): string => {\n        return `Hello ${name}!`;\n    }),\n} satisfies Routes;\n","src\u002Froutes.ts",[205,389,390,416,420,434,474,501,512],{"__ignoreMap":220},[224,391,392,394,396,398,401,404,406,408,410,412,414],{"class":226,"line":227},[224,393,261],{"class":260},[224,395,265],{"class":264},[224,397,38],{"class":268},[224,399,400],{"class":264},",",[224,402,403],{"class":268}," route",[224,405,272],{"class":264},[224,407,275],{"class":260},[224,409,278],{"class":264},[224,411,305],{"class":234},[224,413,283],{"class":264},[224,415,286],{"class":264},[224,417,418],{"class":226,"line":289},[224,419,339],{"emptyLinePlaceholder":338},[224,421,422,424,426,429,431],{"class":226,"line":312},[224,423,365],{"class":260},[224,425,369],{"class":368},[224,427,428],{"class":268}," routes ",[224,430,375],{"class":264},[224,432,433],{"class":264}," {\n",[224,435,436,440,443,445,448,450,454,456,459,461,464,467,469,472],{"class":226,"line":335},[224,437,439],{"class":438},"swJcz","    sayHello",[224,441,442],{"class":264},":",[224,444,403],{"class":348},[224,446,447],{"class":268},"(",[224,449,447],{"class":264},[224,451,453],{"class":452},"sHdIc","ctx",[224,455,400],{"class":264},[224,457,458],{"class":452}," name",[224,460,442],{"class":264},[224,462,463],{"class":230}," string",[224,465,466],{"class":264},"):",[224,468,463],{"class":230},[224,470,471],{"class":368}," =>",[224,473,433],{"class":264},[224,475,476,479,482,485,488,491,493,496,499],{"class":226,"line":342},[224,477,478],{"class":260},"        return",[224,480,481],{"class":264}," `",[224,483,484],{"class":234},"Hello ",[224,486,487],{"class":264},"${",[224,489,490],{"class":268},"name",[224,492,272],{"class":264},[224,494,495],{"class":234},"!",[224,497,498],{"class":264},"`",[224,500,286],{"class":264},[224,502,503,506,509],{"class":226,"line":357},[224,504,505],{"class":264},"    }",[224,507,508],{"class":268},")",[224,510,511],{"class":264},",\n",[224,513,514,516,519,522],{"class":226,"line":362},[224,515,272],{"class":264},[224,517,518],{"class":260}," satisfies",[224,520,521],{"class":230}," Routes",[224,523,286],{"class":264},[210,525,527],{"id":526},"api-gateway-configuration","API Gateway Configuration",[201,529,530],{},"mion works with both REST API and HTTP API (v2) in API Gateway. Make sure to configure a catch-all route:",[215,532,536],{"className":533,"code":534,"language":535,"meta":220,"style":220},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# serverless.yml example\nfunctions:\n  api:\n    handler: src\u002Fhandler.handler\n    events:\n      - httpApi:\n          method: '*'\n          path: '\u002F{proxy+}'\n","yaml",[205,537,538,544,552,559,569,576,586,601],{"__ignoreMap":220},[224,539,540],{"class":226,"line":227},[224,541,543],{"class":542},"sHwdD","# serverless.yml example\n",[224,545,546,549],{"class":226,"line":289},[224,547,548],{"class":438},"functions",[224,550,551],{"class":264},":\n",[224,553,554,557],{"class":226,"line":312},[224,555,556],{"class":438},"  api",[224,558,551],{"class":264},[224,560,561,564,566],{"class":226,"line":335},[224,562,563],{"class":438},"    handler",[224,565,442],{"class":264},[224,567,568],{"class":234}," src\u002Fhandler.handler\n",[224,570,571,574],{"class":226,"line":342},[224,572,573],{"class":438},"    events",[224,575,551],{"class":264},[224,577,578,581,584],{"class":226,"line":357},[224,579,580],{"class":264},"      -",[224,582,583],{"class":438}," httpApi",[224,585,551],{"class":264},[224,587,588,591,593,595,598],{"class":226,"line":362},[224,589,590],{"class":438},"          method",[224,592,442],{"class":264},[224,594,278],{"class":264},[224,596,597],{"class":234},"*",[224,599,600],{"class":264},"'\n",[224,602,604,607,609,611,614],{"class":226,"line":603},8,[224,605,606],{"class":438},"          path",[224,608,442],{"class":264},[224,610,278],{"class":264},[224,612,613],{"class":234},"\u002F{proxy+}",[224,615,600],{"class":264},[210,617,619],{"id":618},"configuration","Configuration",[201,621,622,623,442],{},"You can pass configuration options to ",[205,624,625],{},"initMionAws",[215,627,629],{"className":250,"code":628,"language":253,"meta":220,"style":220},"import {createAwsLambdaHandler} from '@mionjs\u002Fplatform-aws';\nimport {initMionRouter} from '@mionjs\u002Frouter';\nimport {routes} from '.\u002Faws-routes.ts';\n\nawait initMionRouter(routes, {\n    basePath: 'api', \u002F\u002F API prefix\n});\n\nexport const handler = createAwsLambdaHandler({});\n",[205,630,631,651,671,691,695,708,727,735,739],{"__ignoreMap":220},[224,632,633,635,637,639,641,643,645,647,649],{"class":226,"line":227},[224,634,261],{"class":260},[224,636,265],{"class":264},[224,638,269],{"class":268},[224,640,272],{"class":264},[224,642,275],{"class":260},[224,644,278],{"class":264},[224,646,207],{"class":234},[224,648,283],{"class":264},[224,650,286],{"class":264},[224,652,653,655,657,659,661,663,665,667,669],{"class":226,"line":289},[224,654,261],{"class":260},[224,656,265],{"class":264},[224,658,296],{"class":268},[224,660,272],{"class":264},[224,662,275],{"class":260},[224,664,278],{"class":264},[224,666,305],{"class":234},[224,668,283],{"class":264},[224,670,286],{"class":264},[224,672,673,675,677,679,681,683,685,687,689],{"class":226,"line":312},[224,674,261],{"class":260},[224,676,265],{"class":264},[224,678,319],{"class":268},[224,680,272],{"class":264},[224,682,275],{"class":260},[224,684,278],{"class":264},[224,686,328],{"class":234},[224,688,283],{"class":264},[224,690,286],{"class":264},[224,692,693],{"class":226,"line":335},[224,694,339],{"emptyLinePlaceholder":338},[224,696,697,699,701,704,706],{"class":226,"line":342},[224,698,345],{"class":260},[224,700,349],{"class":348},[224,702,703],{"class":268},"(routes",[224,705,400],{"class":264},[224,707,433],{"class":264},[224,709,710,713,715,717,720,722,724],{"class":226,"line":357},[224,711,712],{"class":438},"    basePath",[224,714,442],{"class":264},[224,716,278],{"class":264},[224,718,719],{"class":234},"api",[224,721,283],{"class":264},[224,723,400],{"class":264},[224,725,726],{"class":542}," \u002F\u002F API prefix\n",[224,728,729,731,733],{"class":226,"line":362},[224,730,272],{"class":264},[224,732,508],{"class":268},[224,734,286],{"class":264},[224,736,737],{"class":226,"line":603},[224,738,339],{"emptyLinePlaceholder":338},[224,740,742,744,746,748,750,752,754,757,759],{"class":226,"line":741},9,[224,743,365],{"class":260},[224,745,369],{"class":368},[224,747,372],{"class":268},[224,749,375],{"class":264},[224,751,378],{"class":348},[224,753,447],{"class":268},[224,755,756],{"class":264},"{}",[224,758,508],{"class":268},[224,760,286],{"class":264},[762,763,764],"tip",{},"For optimal cold start performance, keep your Lambda function dependencies minimal and use Lambda layers for shared code.",[766,767],"spacer",{},[210,769,771],{"id":770},"type-reference","Type Reference",[773,774,776],"h3",{"id":775},"awslambdaoptions","AwsLambdaOptions",[215,778,780],{"className":250,"code":779,"language":253,"meta":220,"style":220},"export interface AwsLambdaOptions {\n    \u002F** Set of default response header to add to every response*\u002F\n    defaultResponseHeaders: Record\u003Cstring, string>;\n}\n",[205,781,782,794,799,822],{"__ignoreMap":220},[224,783,784,786,789,792],{"class":226,"line":227},[224,785,365],{"class":260},[224,787,788],{"class":368}," interface",[224,790,791],{"class":230}," AwsLambdaOptions",[224,793,433],{"class":264},[224,795,796],{"class":226,"line":289},[224,797,798],{"class":542},"    \u002F** Set of default response header to add to every response*\u002F\n",[224,800,801,804,806,809,812,815,817,819],{"class":226,"line":312},[224,802,803],{"class":438},"    defaultResponseHeaders",[224,805,442],{"class":264},[224,807,808],{"class":230}," Record",[224,810,811],{"class":264},"\u003C",[224,813,814],{"class":230},"string",[224,816,400],{"class":264},[224,818,463],{"class":230},[224,820,821],{"class":264},">;\n",[224,823,824],{"class":226,"line":335},[224,825,826],{"class":264},"}\n",[828,829,830],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}","Running mion APIs on AWS Lambda for serverless deployments.","md",null,{"toc":26},{"title":162,"description":831},"eJheDfy2u0EFpxcCeAHkqU54DTCWVNwsa81cpE6hm9c",[838,840],{"title":158,"path":159,"stem":160,"description":839,"children":-1},"Running mion APIs on Bun runtime for maximum performance.",{"title":166,"path":167,"stem":168,"description":841,"children":-1},"Running mion APIs on Google Cloud Functions for serverless deployments.",1778674524008]