[{"data":1,"prerenderedAt":1249},["ShallowReactive",2],{"navigation_docs":3,"-rpc-platforms-vercel":399},[4,162,346],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":24},"RPC","icon-park-outline:lightning","\u002Frpc","01.rpc",[10,25,63,77,102,136],{"title":11,"icon":12,"redirect":7,"path":13,"stem":14,"children":15,"page":24},"Introduction","icon-park-outline:home","\u002Frpc\u002Fintroduction","01.rpc\u002F01.introduction",[16,20],{"title":17,"path":18,"stem":19},"Quick Start","\u002Frpc\u002Fintroduction\u002Fquick-start","01.rpc\u002F01.introduction\u002F02.quick-start",{"title":21,"path":22,"stem":23},"Manual Install","\u002Frpc\u002Fintroduction\u002Fmanual-install","01.rpc\u002F01.introduction\u002F03.manual-install",false,{"title":26,"icon":27,"path":28,"stem":29,"children":30,"page":24},"Server","icon-park-outline:server","\u002Frpc\u002Fserver","01.rpc\u002F02.server",[31,35,39,43,47,51,55,59],{"title":32,"path":33,"stem":34},"Routes","\u002Frpc\u002Fserver\u002Froutes","01.rpc\u002F02.server\u002F01.routes",{"title":36,"path":37,"stem":38},"Middleware","\u002Frpc\u002Fserver\u002Fmiddleware","01.rpc\u002F02.server\u002F02.middleware",{"title":40,"path":41,"stem":42},"Call Context","\u002Frpc\u002Fserver\u002Fcall-context","01.rpc\u002F02.server\u002F03.call-context",{"title":44,"path":45,"stem":46},"Headers","\u002Frpc\u002Fserver\u002Fheaders","01.rpc\u002F02.server\u002F04.headers",{"title":48,"path":49,"stem":50},"Error Handling","\u002Frpc\u002Fserver\u002Ferror-handling","01.rpc\u002F02.server\u002F05.error-handling",{"title":52,"path":53,"stem":54},"Validation","\u002Frpc\u002Fserver\u002Fvalidation","01.rpc\u002F02.server\u002F06.validation",{"title":56,"path":57,"stem":58},"JSON Round Trip","\u002Frpc\u002Fserver\u002Fjson-round-trip","01.rpc\u002F02.server\u002F07.json-round-trip",{"title":60,"path":61,"stem":62},"Drizzle Tables","\u002Frpc\u002Fserver\u002Fdrizzle-tables","01.rpc\u002F02.server\u002F08.drizzle-tables",{"title":64,"icon":65,"path":66,"stem":67,"children":68,"page":24},"Middlewares","icon-park-outline:link-one","\u002Frpc\u002Fmiddlewares","01.rpc\u002F03.middlewares",[69,73],{"title":70,"path":71,"stem":72},"fetchMetadata","\u002Frpc\u002Fmiddlewares\u002Ffetch-metadata","01.rpc\u002F03.middlewares\u002F01.fetch-metadata",{"title":74,"path":75,"stem":76},"syncRoutes","\u002Frpc\u002Fmiddlewares\u002Fsync-routes","01.rpc\u002F03.middlewares\u002F02.sync-routes",{"title":78,"icon":79,"path":80,"stem":81,"children":82,"page":24},"Client","icon-park-outline:computer","\u002Frpc\u002Fclient","01.rpc\u002F04.client",[83,87,91,94,98],{"title":84,"path":85,"stem":86},"Client Overview","\u002Frpc\u002Fclient\u002Fclient-overview","01.rpc\u002F04.client\u002F00.client-overview",{"title":88,"path":89,"stem":90},"Client Middleware","\u002Frpc\u002Fclient\u002Fclient-middleware","01.rpc\u002F04.client\u002F01.client-middleware",{"title":48,"path":92,"stem":93},"\u002Frpc\u002Fclient\u002Ferror-handling","01.rpc\u002F04.client\u002F02.error-handling",{"title":95,"path":96,"stem":97},"Batch Requests","\u002Frpc\u002Fclient\u002Fbatch","01.rpc\u002F04.client\u002F03.batch",{"title":99,"path":100,"stem":101},"Cancellation & Timeouts","\u002Frpc\u002Fclient\u002Fcancellation-timeouts","01.rpc\u002F04.client\u002F04.cancellation-timeouts",{"title":103,"redirect":104,"icon":105,"path":106,"stem":107,"children":108,"page":24},"Platforms","\u002Frpc\u002Fplatforms\u002Fnode-js","icon-park-outline:play","\u002Frpc\u002Fplatforms","01.rpc\u002F06.platforms",[109,112,116,120,124,128,132],{"title":110,"path":104,"stem":111},"Node.js","01.rpc\u002F06.platforms\u002F01.node-js",{"title":113,"path":114,"stem":115},"Bun","\u002Frpc\u002Fplatforms\u002Fbun","01.rpc\u002F06.platforms\u002F02.bun",{"title":117,"path":118,"stem":119},"AWS Lambda","\u002Frpc\u002Fplatforms\u002Faws-lambda","01.rpc\u002F06.platforms\u002F03.aws-lambda",{"title":121,"path":122,"stem":123},"Google Cloud Functions","\u002Frpc\u002Fplatforms\u002Fgoogle-cloud-functions","01.rpc\u002F06.platforms\u002F04.google-cloud-functions",{"title":125,"path":126,"stem":127},"Cloudflare Workers","\u002Frpc\u002Fplatforms\u002Fcloudflare","01.rpc\u002F06.platforms\u002F05.cloudflare",{"title":129,"path":130,"stem":131},"Vercel","\u002Frpc\u002Fplatforms\u002Fvercel","01.rpc\u002F06.platforms\u002F06.vercel",{"title":133,"path":134,"stem":135},"uWebSockets.js","\u002Frpc\u002Fplatforms\u002Fuwebsockets","01.rpc\u002F06.platforms\u002F07.uwebsockets",{"title":137,"icon":138,"path":139,"stem":140,"children":141,"page":24},"Devtools","icon-park-outline:tool","\u002Frpc\u002Fdevtools","01.rpc\u002F07.devtools",[142,146,150,154,158],{"title":143,"path":144,"stem":145},"Linter","\u002Frpc\u002Fdevtools\u002Flinter","01.rpc\u002F07.devtools\u002F01.linter",{"title":147,"path":148,"stem":149},"Vite","\u002Frpc\u002Fdevtools\u002Fvite","01.rpc\u002F07.devtools\u002F02.vite",{"title":151,"path":152,"stem":153},"Next.js","\u002Frpc\u002Fdevtools\u002Fnextjs","01.rpc\u002F07.devtools\u002F03.nextjs",{"title":155,"path":156,"stem":157},"CLI","\u002Frpc\u002Fdevtools\u002Fcli","01.rpc\u002F07.devtools\u002F04.cli",{"title":159,"path":160,"stem":161},"API Types","\u002Frpc\u002Fdevtools\u002Fapi-types","01.rpc\u002F07.devtools\u002F05.api-types",{"title":163,"icon":164,"path":165,"stem":166,"children":167,"page":24},"RunTypes","i-lucide-braces","\u002Fruntypes","02.runtypes",[168,184,224,254,268,290,332],{"title":11,"icon":169,"redirect":165,"path":170,"stem":171,"children":172,"page":24},"i-lucide-rocket","\u002Fruntypes\u002Fintroduction","02.runtypes\u002F01.introduction",[173,177,180],{"title":174,"path":175,"stem":176},"Built on typescript-go","\u002Fruntypes\u002Fintroduction\u002Fbuilt-on-typescript-go","02.runtypes\u002F01.introduction\u002F02.built-on-typescript-go",{"title":17,"path":178,"stem":179},"\u002Fruntypes\u002Fintroduction\u002Fquick-start","02.runtypes\u002F01.introduction\u002F03.quick-start",{"title":181,"path":182,"stem":183},"Configuration","\u002Fruntypes\u002Fintroduction\u002Fconfiguration","02.runtypes\u002F01.introduction\u002F04.configuration",{"title":185,"icon":186,"redirect":187,"path":188,"stem":189,"children":190,"page":24},"Guide","i-lucide-book-open","\u002Fruntypes\u002Fguide\u002Ftype-builders","\u002Fruntypes\u002Fguide","02.runtypes\u002F02.guide",[191,194,198,201,204,208,212,216,220],{"title":192,"path":187,"stem":193},"Types vs Type Builders","02.runtypes\u002F02.guide\u002F01.type-builders",{"title":195,"path":196,"stem":197},"Reflection","\u002Fruntypes\u002Fguide\u002Freflection","02.runtypes\u002F02.guide\u002F02.reflection",{"title":52,"path":199,"stem":200},"\u002Fruntypes\u002Fguide\u002Fvalidation","02.runtypes\u002F02.guide\u002F03.validation",{"title":56,"path":202,"stem":203},"\u002Fruntypes\u002Fguide\u002Fjson-round-trip","02.runtypes\u002F02.guide\u002F04.json-round-trip",{"title":205,"path":206,"stem":207},"Data Mocking","\u002Fruntypes\u002Fguide\u002Fmocking","02.runtypes\u002F02.guide\u002F07.mocking",{"title":209,"path":210,"stem":211},"JSON Schemas","\u002Fruntypes\u002Fguide\u002Fjson-schemas","02.runtypes\u002F02.guide\u002F08.json-schemas",{"title":213,"path":214,"stem":215},"Pure Functions","\u002Fruntypes\u002Fguide\u002Fpure-functions","02.runtypes\u002F02.guide\u002F09.pure-functions",{"title":217,"path":218,"stem":219},"Compiler Markers","\u002Fruntypes\u002Fguide\u002Fcompiler-markers","02.runtypes\u002F02.guide\u002F10.compiler-markers",{"title":221,"path":222,"stem":223},"All Compiled Functions","\u002Fruntypes\u002Fguide\u002Fall-compiled-functions","02.runtypes\u002F02.guide\u002F11.all-compiled-functions",{"title":225,"icon":226,"redirect":227,"path":228,"stem":229,"children":230,"page":24},"Type Formats","i-lucide-shapes","\u002Fruntypes\u002Ftype-formats\u002Foverview","\u002Fruntypes\u002Ftype-formats","02.runtypes\u002F03.type-formats",[231,234,238,242,246,250],{"title":232,"path":227,"stem":233},"Overview","02.runtypes\u002F03.type-formats\u002F01.overview",{"title":235,"path":236,"stem":237},"String Formats","\u002Fruntypes\u002Ftype-formats\u002Fstring","02.runtypes\u002F03.type-formats\u002F02.string",{"title":239,"path":240,"stem":241},"Number Formats","\u002Fruntypes\u002Ftype-formats\u002Fnumber","02.runtypes\u002F03.type-formats\u002F03.number",{"title":243,"path":244,"stem":245},"BigInt Formats","\u002Fruntypes\u002Ftype-formats\u002Fbigint","02.runtypes\u002F03.type-formats\u002F04.bigint",{"title":247,"path":248,"stem":249},"Date and Time Formats","\u002Fruntypes\u002Ftype-formats\u002Fdate-time","02.runtypes\u002F03.type-formats\u002F05.date-time",{"title":251,"path":252,"stem":253},"Collection Formats","\u002Fruntypes\u002Ftype-formats\u002Fcollections","02.runtypes\u002F03.type-formats\u002F06.collections",{"title":255,"icon":256,"redirect":257,"path":258,"stem":259,"children":260,"page":24},"Tooling","i-lucide-wrench","\u002Fruntypes\u002Ftooling\u002Flinting","\u002Fruntypes\u002Ftooling","02.runtypes\u002F04.tooling",[261,264],{"title":262,"path":257,"stem":263},"Linting","02.runtypes\u002F04.tooling\u002F01.linting",{"title":265,"path":266,"stem":267},"Source Conversion","\u002Fruntypes\u002Ftooling\u002Fsource-conversion","02.runtypes\u002F04.tooling\u002F02.source-conversion",{"title":269,"icon":270,"redirect":271,"path":272,"stem":273,"children":274,"page":24},"AI Integration","i-lucide-sparkles","\u002Fruntypes\u002Fai-integration\u002Fworkflow-and-commands","\u002Fruntypes\u002Fai-integration","02.runtypes\u002F05.ai-integration",[275,278,282,286],{"title":276,"path":271,"stem":277},"AI Workflow","02.runtypes\u002F05.ai-integration\u002F01.workflow-and-commands",{"title":279,"path":280,"stem":281},"FriendlyText","\u002Fruntypes\u002Fai-integration\u002Ffriendly-text","02.runtypes\u002F05.ai-integration\u002F02.friendly-text",{"title":283,"path":284,"stem":285},"MockData","\u002Fruntypes\u002Fai-integration\u002Fmock-data","02.runtypes\u002F05.ai-integration\u002F03.mock-data",{"title":287,"path":288,"stem":289},"Translations (i18n)","\u002Fruntypes\u002Fai-integration\u002Fi18n","02.runtypes\u002F05.ai-integration\u002F04.i18n",{"title":291,"icon":292,"redirect":293,"path":294,"stem":295,"children":296,"page":24},"Drizzle ORM","i-lineicons-drizzle","\u002Fruntypes\u002Fdrizzle-orm\u002Fdrizzle-overview","\u002Fruntypes\u002Fdrizzle-orm","02.runtypes\u002F06.drizzle-orm",[297,300,304,308,312,316,320,324,328],{"title":298,"path":293,"stem":299},"Drizzle Overview","02.runtypes\u002F06.drizzle-orm\u002F00.drizzle-overview",{"title":301,"path":302,"stem":303},"Column Formats","\u002Fruntypes\u002Fdrizzle-orm\u002Fcolumn-formats","02.runtypes\u002F06.drizzle-orm\u002F01.column-formats",{"title":305,"path":306,"stem":307},"Views","\u002Fruntypes\u002Fdrizzle-orm\u002Fviews","02.runtypes\u002F06.drizzle-orm\u002F02.views",{"title":309,"path":310,"stem":311},"Indexes and Constraints","\u002Fruntypes\u002Fdrizzle-orm\u002Fconstraints","02.runtypes\u002F06.drizzle-orm\u002F03.constraints",{"title":313,"path":314,"stem":315},"Row Level Security","\u002Fruntypes\u002Fdrizzle-orm\u002Frow-level-security","02.runtypes\u002F06.drizzle-orm\u002F04.row-level-security",{"title":317,"path":318,"stem":319},"Relations","\u002Fruntypes\u002Fdrizzle-orm\u002Frelations","02.runtypes\u002F06.drizzle-orm\u002F05.relations",{"title":321,"path":322,"stem":323},"The Schema File","\u002Fruntypes\u002Fdrizzle-orm\u002Fschema-file","02.runtypes\u002F06.drizzle-orm\u002F06.schema-file",{"title":325,"path":326,"stem":327},"Migrate an Existing Schema","\u002Fruntypes\u002Fdrizzle-orm\u002Fmigrate-an-existing-schema","02.runtypes\u002F06.drizzle-orm\u002F07.migrate-an-existing-schema",{"title":329,"path":330,"stem":331},"Cloudflare D1 and Durable Objects","\u002Fruntypes\u002Fdrizzle-orm\u002Fcloudflare-storage","02.runtypes\u002F06.drizzle-orm\u002F08.cloudflare-storage",{"title":333,"icon":334,"redirect":335,"path":336,"stem":337,"children":338,"page":24},"Diagnostics","i-lucide-triangle-alert","\u002Fruntypes\u002Fdiagnostics\u002Ferror-levels","\u002Fruntypes\u002Fdiagnostics","02.runtypes\u002F08.diagnostics",[339,342],{"title":340,"path":335,"stem":341},"Error Levels","02.runtypes\u002F08.diagnostics\u002F01.error-levels",{"title":343,"path":344,"stem":345},"All Diagnostics","\u002Fruntypes\u002Fdiagnostics\u002Fall-diagnostics","02.runtypes\u002F08.diagnostics\u002F02.all-diagnostics",{"title":347,"icon":348,"path":349,"stem":350,"children":351,"page":24},"Benchmarks","i-lucide-gauge","\u002Fbenchmarks","03.benchmarks",[352,372],{"title":5,"icon":6,"redirect":353,"path":354,"stem":355,"children":356,"page":24},"\u002Fbenchmarks\u002Frpc\u002Fhello-world","\u002Fbenchmarks\u002Frpc","03.benchmarks\u002F02.rpc",[357,360,364,368],{"title":358,"path":353,"stem":359},"Hello World","03.benchmarks\u002F02.rpc\u002F01.hello-world",{"title":361,"path":362,"stem":363},"Light Validation","\u002Fbenchmarks\u002Frpc\u002Flight-validation","03.benchmarks\u002F02.rpc\u002F02.light-validation",{"title":365,"path":366,"stem":367},"Heavy Validation","\u002Fbenchmarks\u002Frpc\u002Fheavy-validation","03.benchmarks\u002F02.rpc\u002F03.heavy-validation",{"title":369,"path":370,"stem":371},"Payload Sizes","\u002Fbenchmarks\u002Frpc\u002Fpayload-sizes","03.benchmarks\u002F02.rpc\u002F04.payload-sizes",{"title":163,"icon":164,"redirect":373,"path":374,"stem":375,"children":376,"page":24},"\u002Fbenchmarks\u002Fruntypes\u002Fis-valid","\u002Fbenchmarks\u002Fruntypes","03.benchmarks\u002F03.runtypes",[377,380,384,388,392,395],{"title":378,"path":373,"stem":379},"Is Valid","03.benchmarks\u002F03.runtypes\u002F01.is-valid",{"title":381,"path":382,"stem":383},"Is Valid Formats","\u002Fbenchmarks\u002Fruntypes\u002Fis-valid-formats","03.benchmarks\u002F03.runtypes\u002F02.is-valid-formats",{"title":385,"path":386,"stem":387},"Get Errors","\u002Fbenchmarks\u002Fruntypes\u002Fget-errors","03.benchmarks\u002F03.runtypes\u002F03.get-errors",{"title":389,"path":390,"stem":391},"Get Errors Formats","\u002Fbenchmarks\u002Fruntypes\u002Fget-errors-formats","03.benchmarks\u002F03.runtypes\u002F04.get-errors-formats",{"title":56,"path":393,"stem":394},"\u002Fbenchmarks\u002Fruntypes\u002Fjson-round-trip","03.benchmarks\u002F03.runtypes\u002F05.json-round-trip",{"title":396,"path":397,"stem":398},"Type Checking","\u002Fbenchmarks\u002Fruntypes\u002Ftype-checking","03.benchmarks\u002F03.runtypes\u002F07.type-checking",{"id":400,"title":129,"body":401,"description":1243,"extension":1244,"links":1245,"meta":1246,"navigation":528,"path":130,"seo":1247,"stem":131,"__hash__":1248},"docs\u002F01.rpc\u002F06.platforms\u002F06.vercel.md",{"type":402,"value":403},"minimark",[404,430,435,463,467,833,837,848,856,864,868,895,1003,1007,1029,1134,1142,1239],[405,406,407,411,412,415,416,415,419,415,422,425,426,429],"p",{},[408,409,410],"code",{},"@mionjs\u002Fplatform-vercel"," runs mion as Next.js App Router route handlers. It returns ",[408,413,414],{},"GET",", ",[408,417,418],{},"POST",[408,420,421],{},"PUT",[408,423,424],{},"DELETE"," and ",[408,427,428],{},"PATCH"," handlers that you re-export from a catch-all route file.",[431,432,434],"h2",{"id":433},"installing-the-adapter","Installing the Adapter",[436,437,442],"pre",{"className":438,"code":439,"language":440,"meta":441,"style":441},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm install @mionjs\u002Fplatform-vercel @mionjs\u002Frouter\n","bash","",[408,443,444],{"__ignoreMap":441},[445,446,449,453,457,460],"span",{"class":447,"line":448},"line",1,[445,450,452],{"class":451},"sBMFI","npm",[445,454,456],{"class":455},"sfazB"," install",[445,458,459],{"class":455}," @mionjs\u002Fplatform-vercel",[445,461,462],{"class":455}," @mionjs\u002Frouter\n",[431,464,466],{"id":465},"creating-the-handler","Creating the Handler",[468,469,470,579],"code-group",{},[436,471,476],{"className":472,"code":473,"filename":474,"language":475,"meta":441,"style":441},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {createVercelHandler} from '@mionjs\u002Fplatform-vercel';\nimport '.\u002Fvercel-routes.ts';\n\nexport const {GET, POST, PUT, DELETE, PATCH} = createVercelHandler();\n","app\u002Fapi\u002F[...mion]\u002Froute.ts","ts",[408,477,478,509,523,530],{"__ignoreMap":441},[445,479,480,484,488,492,495,498,501,503,506],{"class":447,"line":448},[445,481,483],{"class":482},"s7zQu","import",[445,485,487],{"class":486},"sMK4o"," {",[445,489,491],{"class":490},"sTEyZ","createVercelHandler",[445,493,494],{"class":486},"}",[445,496,497],{"class":482}," from",[445,499,500],{"class":486}," '",[445,502,410],{"class":455},[445,504,505],{"class":486},"'",[445,507,508],{"class":486},";\n",[445,510,512,514,516,519,521],{"class":447,"line":511},2,[445,513,483],{"class":482},[445,515,500],{"class":486},[445,517,518],{"class":455},".\u002Fvercel-routes.ts",[445,520,505],{"class":486},[445,522,508],{"class":486},[445,524,526],{"class":447,"line":525},3,[445,527,529],{"emptyLinePlaceholder":528},true,"\n",[445,531,533,536,540,542,544,547,550,552,555,557,560,562,565,567,570,574,577],{"class":447,"line":532},4,[445,534,535],{"class":482},"export",[445,537,539],{"class":538},"spNyl"," const",[445,541,487],{"class":486},[445,543,414],{"class":490},[445,545,546],{"class":486},",",[445,548,549],{"class":490}," POST",[445,551,546],{"class":486},[445,553,554],{"class":490}," PUT",[445,556,546],{"class":486},[445,558,559],{"class":490}," DELETE",[445,561,546],{"class":486},[445,563,564],{"class":490}," PATCH",[445,566,494],{"class":486},[445,568,569],{"class":486}," =",[445,571,573],{"class":572},"s2Zo4"," createVercelHandler",[445,575,576],{"class":490},"()",[445,578,508],{"class":486},[436,580,583],{"className":472,"code":581,"filename":582,"language":475,"meta":441,"style":441},"import {createMionRouter, Routes} from '@mionjs\u002Frouter';\n\n\u002F\u002F the catch-all handler is mounted under \u002Fapi, so the router gets that prefix\nconst mion = createMionRouter({basePath: '\u002Fapi'});\n\nconst routes = {\n  sayHello: mion.route((ctx, name: string): string => {\n    return `Hello ${name}!`;\n  }),\n} satisfies Routes;\n\n\u002F\u002F the server entry only imports this file\nexport const myApi = mion.initRoutes(routes);\nexport type MyApi = typeof myApi;\n","src\u002Froutes.ts",[408,584,585,612,616,622,663,668,681,726,754,765,777,782,788,812],{"__ignoreMap":441},[445,586,587,589,591,594,596,599,601,603,605,608,610],{"class":447,"line":448},[445,588,483],{"class":482},[445,590,487],{"class":486},[445,592,593],{"class":490},"createMionRouter",[445,595,546],{"class":486},[445,597,598],{"class":490}," Routes",[445,600,494],{"class":486},[445,602,497],{"class":482},[445,604,500],{"class":486},[445,606,607],{"class":455},"@mionjs\u002Frouter",[445,609,505],{"class":486},[445,611,508],{"class":486},[445,613,614],{"class":447,"line":511},[445,615,529],{"emptyLinePlaceholder":528},[445,617,618],{"class":447,"line":525},[445,619,621],{"class":620},"sHwdD","\u002F\u002F the catch-all handler is mounted under \u002Fapi, so the router gets that prefix\n",[445,623,624,627,630,633,636,639,642,646,649,651,654,656,658,661],{"class":447,"line":532},[445,625,626],{"class":538},"const",[445,628,629],{"class":490}," mion ",[445,631,632],{"class":486},"=",[445,634,635],{"class":572}," createMionRouter",[445,637,638],{"class":490},"(",[445,640,641],{"class":486},"{",[445,643,645],{"class":644},"swJcz","basePath",[445,647,648],{"class":486},":",[445,650,500],{"class":486},[445,652,653],{"class":455},"\u002Fapi",[445,655,505],{"class":486},[445,657,494],{"class":486},[445,659,660],{"class":490},")",[445,662,508],{"class":486},[445,664,666],{"class":447,"line":665},5,[445,667,529],{"emptyLinePlaceholder":528},[445,669,671,673,676,678],{"class":447,"line":670},6,[445,672,626],{"class":538},[445,674,675],{"class":490}," routes ",[445,677,632],{"class":486},[445,679,680],{"class":486}," {\n",[445,682,684,687,689,692,695,698,700,702,706,708,711,713,716,719,721,724],{"class":447,"line":683},7,[445,685,686],{"class":644},"  sayHello",[445,688,648],{"class":486},[445,690,691],{"class":490}," mion",[445,693,694],{"class":486},".",[445,696,697],{"class":572},"route",[445,699,638],{"class":490},[445,701,638],{"class":486},[445,703,705],{"class":704},"sHdIc","ctx",[445,707,546],{"class":486},[445,709,710],{"class":704}," name",[445,712,648],{"class":486},[445,714,715],{"class":451}," string",[445,717,718],{"class":486},"):",[445,720,715],{"class":451},[445,722,723],{"class":538}," =>",[445,725,680],{"class":486},[445,727,729,732,735,738,741,744,746,749,752],{"class":447,"line":728},8,[445,730,731],{"class":482},"    return",[445,733,734],{"class":486}," `",[445,736,737],{"class":455},"Hello ",[445,739,740],{"class":486},"${",[445,742,743],{"class":490},"name",[445,745,494],{"class":486},[445,747,748],{"class":455},"!",[445,750,751],{"class":486},"`",[445,753,508],{"class":486},[445,755,757,760,762],{"class":447,"line":756},9,[445,758,759],{"class":486},"  }",[445,761,660],{"class":490},[445,763,764],{"class":486},",\n",[445,766,768,770,773,775],{"class":447,"line":767},10,[445,769,494],{"class":486},[445,771,772],{"class":482}," satisfies",[445,774,598],{"class":451},[445,776,508],{"class":486},[445,778,780],{"class":447,"line":779},11,[445,781,529],{"emptyLinePlaceholder":528},[445,783,785],{"class":447,"line":784},12,[445,786,787],{"class":620},"\u002F\u002F the server entry only imports this file\n",[445,789,791,793,795,798,800,802,804,807,810],{"class":447,"line":790},13,[445,792,535],{"class":482},[445,794,539],{"class":538},[445,796,797],{"class":490}," myApi ",[445,799,632],{"class":486},[445,801,691],{"class":490},[445,803,694],{"class":486},[445,805,806],{"class":572},"initRoutes",[445,808,809],{"class":490},"(routes)",[445,811,508],{"class":486},[445,813,815,817,820,823,825,828,831],{"class":447,"line":814},14,[445,816,535],{"class":482},[445,818,819],{"class":538}," type",[445,821,822],{"class":451}," MyApi",[445,824,569],{"class":486},[445,826,827],{"class":486}," typeof",[445,829,830],{"class":490}," myApi",[445,832,508],{"class":486},[431,834,836],{"id":835},"catch-all-route","Catch-all Route",[405,838,839,840,843,844,847],{},"One route file handles every method. Place it in a Next.js App Router catch-all directory, whose ",[408,841,842],{},"[...mion]"," segment sends every path under ",[408,845,846],{},"\u002Fapi\u002F"," to mion's router.",[436,849,854],{"className":850,"code":852,"language":853},[851],"language-text","app\u002F\n  api\u002F\n    [...mion]\u002F\n      route.ts   ← exports GET\u002FPOST\u002FPUT\u002FDELETE\u002FPATCH from createVercelHandler()\n","text",[408,855,852],{"__ignoreMap":441},[405,857,858,859,694],{},"The same handler also hosts your API inside a Next app, see ",[860,861,863],"a",{"href":862},"\u002Frpc\u002Fdevtools\u002Fnextjs#hosting-the-api-in-your-next-app","Hosting the API in Your Next App",[431,865,867],{"id":866},"api-base-path","API Base Path",[405,869,870,871,874,875,879,880,884,885,888,889,891,892,894],{},"Set ",[408,872,873],{},"basePath: '\u002Fapi'"," on the ",[860,876,878],{"href":877},"\u002Frpc\u002Fserver\u002Froutes#creating-the-router","router"," ",[881,882,883],"strong",{},"and"," the client, and point the client's ",[408,886,887],{},"baseURL"," at the origin. Putting ",[408,890,653],{}," in ",[408,893,887],{}," does not work: a route path is absolute, so it replaces the base's path and drops the prefix.",[436,896,898],{"className":472,"code":897,"language":475,"meta":441,"style":441},"\u002F\u002F your routes module\nconst mion = createMionRouter({basePath: '\u002Fapi'});\n\n\u002F\u002F your client\nconst {routes} = initClient\u003CMyApi>({baseURL: 'https:\u002F\u002Fyour-app.vercel.app', basePath: '\u002Fapi'});\n",[408,899,900,905,935,939,944],{"__ignoreMap":441},[445,901,902],{"class":447,"line":448},[445,903,904],{"class":620},"\u002F\u002F your routes module\n",[445,906,907,909,911,913,915,917,919,921,923,925,927,929,931,933],{"class":447,"line":511},[445,908,626],{"class":538},[445,910,629],{"class":490},[445,912,632],{"class":486},[445,914,635],{"class":572},[445,916,638],{"class":490},[445,918,641],{"class":486},[445,920,645],{"class":644},[445,922,648],{"class":486},[445,924,500],{"class":486},[445,926,653],{"class":455},[445,928,505],{"class":486},[445,930,494],{"class":486},[445,932,660],{"class":490},[445,934,508],{"class":486},[445,936,937],{"class":447,"line":525},[445,938,529],{"emptyLinePlaceholder":528},[445,940,941],{"class":447,"line":532},[445,942,943],{"class":620},"\u002F\u002F your client\n",[445,945,946,948,950,953,955,957,960,963,966,969,971,973,975,977,979,982,984,986,989,991,993,995,997,999,1001],{"class":447,"line":665},[445,947,626],{"class":538},[445,949,487],{"class":486},[445,951,952],{"class":490},"routes",[445,954,494],{"class":486},[445,956,569],{"class":486},[445,958,959],{"class":572}," initClient",[445,961,962],{"class":486},"\u003C",[445,964,965],{"class":451},"MyApi",[445,967,968],{"class":486},">",[445,970,638],{"class":490},[445,972,641],{"class":486},[445,974,887],{"class":644},[445,976,648],{"class":486},[445,978,500],{"class":486},[445,980,981],{"class":455},"https:\u002F\u002Fyour-app.vercel.app",[445,983,505],{"class":486},[445,985,546],{"class":486},[445,987,988],{"class":644}," basePath",[445,990,648],{"class":486},[445,992,500],{"class":486},[445,994,653],{"class":455},[445,996,505],{"class":486},[445,998,494],{"class":486},[445,1000,660],{"class":490},[445,1002,508],{"class":486},[431,1004,1006],{"id":1005},"handler-options","Handler Options",[405,1008,1009,1010,1013,1014,1017,1018,1020,1021,1023,1024,1028],{},"Pass options such as ",[408,1011,1012],{},"maxBodySize"," (128 KB by default) and ",[408,1015,1016],{},"maxBodySizeCap"," to ",[408,1019,491],{},". ",[408,1022,1016],{}," defaults to the 4.5 MB Vercel allows, and Vercel refuses anything bigger before the function runs; override it if Vercel changes it. Each route has its own ",[860,1025,1027],{"href":1026},"\u002Frpc\u002Fserver\u002Froutes#request-size","body limit",", and a body stream past it is cancelled with a 413.",[436,1030,1032],{"className":472,"code":1031,"language":475,"meta":441,"style":441},"import {createVercelHandler} from '@mionjs\u002Fplatform-vercel';\nimport '.\u002Fvercel-routes.ts';\n\nexport const {GET, POST, PUT, DELETE, PATCH} = createVercelHandler({\n  maxBodySize: 512 * 1024,\n});\n",[408,1033,1034,1054,1066,1070,1107,1126],{"__ignoreMap":441},[445,1035,1036,1038,1040,1042,1044,1046,1048,1050,1052],{"class":447,"line":448},[445,1037,483],{"class":482},[445,1039,487],{"class":486},[445,1041,491],{"class":490},[445,1043,494],{"class":486},[445,1045,497],{"class":482},[445,1047,500],{"class":486},[445,1049,410],{"class":455},[445,1051,505],{"class":486},[445,1053,508],{"class":486},[445,1055,1056,1058,1060,1062,1064],{"class":447,"line":511},[445,1057,483],{"class":482},[445,1059,500],{"class":486},[445,1061,518],{"class":455},[445,1063,505],{"class":486},[445,1065,508],{"class":486},[445,1067,1068],{"class":447,"line":525},[445,1069,529],{"emptyLinePlaceholder":528},[445,1071,1072,1074,1076,1078,1080,1082,1084,1086,1088,1090,1092,1094,1096,1098,1100,1102,1104],{"class":447,"line":532},[445,1073,535],{"class":482},[445,1075,539],{"class":538},[445,1077,487],{"class":486},[445,1079,414],{"class":490},[445,1081,546],{"class":486},[445,1083,549],{"class":490},[445,1085,546],{"class":486},[445,1087,554],{"class":490},[445,1089,546],{"class":486},[445,1091,559],{"class":490},[445,1093,546],{"class":486},[445,1095,564],{"class":490},[445,1097,494],{"class":486},[445,1099,569],{"class":486},[445,1101,573],{"class":572},[445,1103,638],{"class":490},[445,1105,1106],{"class":486},"{\n",[445,1108,1109,1112,1114,1118,1121,1124],{"class":447,"line":665},[445,1110,1111],{"class":644},"  maxBodySize",[445,1113,648],{"class":486},[445,1115,1117],{"class":1116},"sbssI"," 512",[445,1119,1120],{"class":486}," *",[445,1122,1123],{"class":1116}," 1024",[445,1125,764],{"class":486},[445,1127,1128,1130,1132],{"class":447,"line":670},[445,1129,494],{"class":486},[445,1131,660],{"class":490},[445,1133,508],{"class":486},[1135,1136,1137,1138,1141],"tip",{},"The handler uses the Web standard ",[408,1139,1140],{},"Request -> Response"," API, so it runs on both the Node.js and Edge runtimes without changes.",[1143,1144,1145,1165,1223],"caution",{},[405,1146,1147,1148,1151,1152,425,1155,1158,1159,874,1162,648],{},"The ",[881,1149,1150],{},"Edge runtime"," forbids ",[408,1153,1154],{},"new Function()",[408,1156,1157],{},"eval()",", so an Edge build must set\n",[408,1160,1161],{},"runTypes: {emitMode: 'both'}",[860,1163,1164],{"href":148},"mion Vite plugin",[436,1166,1169],{"className":472,"code":1167,"filename":1168,"language":475,"meta":441,"style":441},"mionVitePlugin({\n    runTypes: {\n        \u002F\u002F required on Edge: no `new Function` at runtime\n        emitMode: 'both',\n    },\n}),\n","vite.config.ts",[408,1170,1171,1180,1189,1194,1210,1215],{"__ignoreMap":441},[445,1172,1173,1176,1178],{"class":447,"line":448},[445,1174,1175],{"class":572},"mionVitePlugin",[445,1177,638],{"class":490},[445,1179,1106],{"class":486},[445,1181,1182,1185,1187],{"class":447,"line":511},[445,1183,1184],{"class":644},"    runTypes",[445,1186,648],{"class":486},[445,1188,680],{"class":486},[445,1190,1191],{"class":447,"line":525},[445,1192,1193],{"class":620},"        \u002F\u002F required on Edge: no `new Function` at runtime\n",[445,1195,1196,1199,1201,1203,1206,1208],{"class":447,"line":532},[445,1197,1198],{"class":644},"        emitMode",[445,1200,648],{"class":486},[445,1202,500],{"class":486},[445,1204,1205],{"class":455},"both",[445,1207,505],{"class":486},[445,1209,764],{"class":486},[445,1211,1212],{"class":447,"line":665},[445,1213,1214],{"class":486},"    },\n",[445,1216,1217,1219,1221],{"class":447,"line":670},[445,1218,494],{"class":486},[445,1220,660],{"class":490},[445,1222,764],{"class":486},[405,1224,1225,1226,1229,1230,1234,1235,1238],{},"Otherwise ",[408,1227,1228],{},"mion.initRoutes"," fails with ",[1231,1232,1233],"em",{},"\"Code generation from strings disallowed for this context\"",".\nSee ",[860,1236,125],{"href":1237},"\u002Frpc\u002Fplatforms\u002Fcloudflare#vite-configuration"," for why, and the bundle-size cost.\nNode.js-runtime deployments need no such change.",[1240,1241,1242],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}","Running mion APIs on Vercel using Next.js App Router route handlers.","md",null,{"toc":24},{"title":129,"description":1243},"7nNiMN7TWFmLe6WZ4W3U2nc2FcZT3kLFIYcbPbJqonw",1793324370924]