[{"data":1,"prerenderedAt":2178},["ShallowReactive",2],{"navigation":3,"-docs-tasks":445,"-docs-tasks-surround":2173},[4,123,260,266,430,442],{"title":5,"path":6,"stem":7,"children":8,"icon":122},"","\u002Fdocs","1.docs\u002F1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82,87,92,97,102,107,112,117],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","\u002Fdocs\u002Fquick-start","1.docs\u002F2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","\u002Fdocs\u002Frenderer","1.docs\u002F4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","\u002Fdocs\u002Frouting","1.docs\u002F5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","\u002Fdocs\u002Fassets","1.docs\u002F50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","\u002Fdocs\u002Fconfiguration","1.docs\u002F50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","\u002Fdocs\u002Fdatabase","1.docs\u002F50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","\u002Fdocs\u002Flifecycle","1.docs\u002F50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"OpenAPI","\u002Fdocs\u002Fopenapi","1.docs\u002F50.openapi","ri:contract-line",{"title":53,"path":54,"stem":55,"icon":56},"Plugins","\u002Fdocs\u002Fplugins","1.docs\u002F50.plugins","ri:plug-line",{"title":58,"path":59,"stem":60,"icon":61},"Prerendering","\u002Fdocs\u002Fprerendering","1.docs\u002F50.prerendering","ri:file-copy-2-line",{"title":63,"path":64,"stem":65,"icon":66},"Tasks","\u002Fdocs\u002Ftasks","1.docs\u002F50.tasks","codicon:run-all",{"title":68,"path":69,"stem":70,"icon":71},"WebSocket","\u002Fdocs\u002Fwebsocket","1.docs\u002F50.websocket","ri:broadcast-fill",{"title":73,"path":74,"stem":75,"icon":76},"Modules","\u002Fdocs\u002Fmodules","1.docs\u002F55.modules","i-lucide-puzzle",{"title":78,"path":79,"stem":80,"icon":81},"Server Entry","\u002Fdocs\u002Fserver-entry","1.docs\u002F6.server-entry","ri:server-line",{"title":83,"path":84,"stem":85,"icon":86},"CLI","\u002Fdocs\u002Fcli","1.docs\u002F60.cli","i-lucide-terminal",{"title":88,"path":89,"stem":90,"icon":91},"Vite","\u002Fdocs\u002Fvite","1.docs\u002F61.vite","i-logos-vitejs",{"title":93,"path":94,"stem":95,"icon":96},"Utils","\u002Fdocs\u002Futils","1.docs\u002F62.utils","i-lucide-braces",{"title":98,"path":99,"stem":100,"icon":101},"TypeScript","\u002Fdocs\u002Ftypescript","1.docs\u002F63.typescript","i-logos-typescript-icon",{"title":103,"path":104,"stem":105,"icon":106},"Cache","\u002Fdocs\u002Fcache","1.docs\u002F7.cache","ri:speed-line",{"title":108,"path":109,"stem":110,"icon":111},"KV Storage","\u002Fdocs\u002Fstorage","1.docs\u002F8.storage","carbon:datastore",{"title":113,"path":114,"stem":115,"icon":116},"Migration Guide","\u002Fdocs\u002Fmigration","1.docs\u002F99.migration","ri:arrow-right-up-line",{"title":118,"path":119,"stem":120,"icon":121},"Nightly Channel","\u002Fdocs\u002Fnightly","1.docs\u002F99.nightly","ri:moon-fill","i-lucide-book-open",{"title":124,"path":125,"stem":126,"children":127,"icon":129},"Deploy","\u002Fdeploy","2.deploy\u002F0.index",[128,130,155],{"title":124,"path":125,"stem":126,"icon":129},"ri:upload-cloud-2-line",{"title":131,"path":132,"stem":133,"children":134,"page":154},"Runtimes","\u002Fdeploy\u002Fruntimes","2.deploy\u002F10.runtimes",[135,140,145,150],{"title":136,"path":137,"stem":138,"icon":139},"Node.js","\u002Fdeploy\u002Fruntimes\u002Fnode","2.deploy\u002F10.runtimes\u002F1.node","akar-icons:node-fill",{"title":141,"path":142,"stem":143,"icon":144},"Bun","\u002Fdeploy\u002Fruntimes\u002Fbun","2.deploy\u002F10.runtimes\u002Fbun","simple-icons:bun",{"title":146,"path":147,"stem":148,"icon":149},"Deno","\u002Fdeploy\u002Fruntimes\u002Fdeno","2.deploy\u002F10.runtimes\u002Fdeno","simple-icons:deno",{"title":151,"path":152,"stem":153},"Standard","\u002Fdeploy\u002Fruntimes\u002Fstandard","2.deploy\u002F10.runtimes\u002Fstandard",false,{"title":156,"path":157,"stem":158,"children":159,"page":154},"Providers","\u002Fdeploy\u002Fproviders","2.deploy\u002F20.providers",[160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256],{"title":161,"path":162,"stem":163},"Alwaysdata","\u002Fdeploy\u002Fproviders\u002Falwaysdata","2.deploy\u002F20.providers\u002Falwaysdata",{"title":165,"path":166,"stem":167},"AWS Lambda","\u002Fdeploy\u002Fproviders\u002Faws","2.deploy\u002F20.providers\u002Faws",{"title":169,"path":170,"stem":171},"AWS Amplify","\u002Fdeploy\u002Fproviders\u002Faws-amplify","2.deploy\u002F20.providers\u002Faws-amplify",{"title":173,"path":174,"stem":175},"Azure","\u002Fdeploy\u002Fproviders\u002Fazure","2.deploy\u002F20.providers\u002Fazure",{"title":177,"path":178,"stem":179},"Cleavr","\u002Fdeploy\u002Fproviders\u002Fcleavr","2.deploy\u002F20.providers\u002Fcleavr",{"title":181,"path":182,"stem":183},"Cloudflare","\u002Fdeploy\u002Fproviders\u002Fcloudflare","2.deploy\u002F20.providers\u002Fcloudflare",{"title":185,"path":186,"stem":187},"Deno Deploy","\u002Fdeploy\u002Fproviders\u002Fdeno-deploy","2.deploy\u002F20.providers\u002Fdeno-deploy",{"title":189,"path":190,"stem":191},"DigitalOcean","\u002Fdeploy\u002Fproviders\u002Fdigitalocean","2.deploy\u002F20.providers\u002Fdigitalocean",{"title":193,"path":194,"stem":195},"EdgeOne Pages","\u002Fdeploy\u002Fproviders\u002Fedgeone","2.deploy\u002F20.providers\u002Fedgeone",{"title":197,"path":198,"stem":199},"Firebase","\u002Fdeploy\u002Fproviders\u002Ffirebase","2.deploy\u002F20.providers\u002Ffirebase",{"title":201,"path":202,"stem":203},"Flightcontrol","\u002Fdeploy\u002Fproviders\u002Fflightcontrol","2.deploy\u002F20.providers\u002Fflightcontrol",{"title":205,"path":206,"stem":207},"Genezio","\u002Fdeploy\u002Fproviders\u002Fgenezio","2.deploy\u002F20.providers\u002Fgenezio",{"title":209,"path":210,"stem":211},"GitHub Pages","\u002Fdeploy\u002Fproviders\u002Fgithub-pages","2.deploy\u002F20.providers\u002Fgithub-pages",{"title":213,"path":214,"stem":215},"GitLab Pages","\u002Fdeploy\u002Fproviders\u002Fgitlab-pages","2.deploy\u002F20.providers\u002Fgitlab-pages",{"title":217,"path":218,"stem":219},"Heroku","\u002Fdeploy\u002Fproviders\u002Fheroku","2.deploy\u002F20.providers\u002Fheroku",{"title":221,"path":222,"stem":223},"IIS","\u002Fdeploy\u002Fproviders\u002Fiis","2.deploy\u002F20.providers\u002Fiis",{"title":225,"path":226,"stem":227},"Koyeb","\u002Fdeploy\u002Fproviders\u002Fkoyeb","2.deploy\u002F20.providers\u002Fkoyeb",{"title":229,"path":230,"stem":231},"Netlify","\u002Fdeploy\u002Fproviders\u002Fnetlify","2.deploy\u002F20.providers\u002Fnetlify",{"title":233,"path":234,"stem":235},"Platform.sh","\u002Fdeploy\u002Fproviders\u002Fplatform-sh","2.deploy\u002F20.providers\u002Fplatform-sh",{"title":237,"path":238,"stem":239},"Render.com","\u002Fdeploy\u002Fproviders\u002Frender","2.deploy\u002F20.providers\u002Frender",{"title":241,"path":242,"stem":243},"Stormkit","\u002Fdeploy\u002Fproviders\u002Fstormkit","2.deploy\u002F20.providers\u002Fstormkit",{"title":245,"path":246,"stem":247},"Vercel","\u002Fdeploy\u002Fproviders\u002Fvercel","2.deploy\u002F20.providers\u002Fvercel",{"title":249,"path":250,"stem":251},"Zeabur","\u002Fdeploy\u002Fproviders\u002Fzeabur","2.deploy\u002F20.providers\u002Fzeabur",{"title":253,"path":254,"stem":255},"Zephyr Cloud","\u002Fdeploy\u002Fproviders\u002Fzephyr","2.deploy\u002F20.providers\u002Fzephyr",{"title":257,"path":258,"stem":259},"Zerops","\u002Fdeploy\u002Fproviders\u002Fzerops","2.deploy\u002F20.providers\u002Fzerops",{"title":261,"path":262,"stem":263,"children":264,"icon":36},"Config","\u002Fconfig","3.config\u002F0.index",[265],{"title":261,"path":262,"stem":263,"icon":36},{"title":267,"path":268,"stem":269,"children":270,"icon":272},"Examples","\u002Fexamples","4.examples\u002F0.index",[271,273,278,283,288,293,297,302,307,312,317,322,327,331,336,340,344,349,354,359,364,369,374,379,383,388,393,398,402,407,412,416,421,426],{"title":267,"path":268,"stem":269,"icon":272},"i-lucide-folder-code",{"title":274,"path":275,"stem":276,"icon":277},"API Routes","\u002Fexamples\u002Fapi-routes","4.examples\u002Fapi-routes","i-lucide-route",{"title":279,"path":280,"stem":281,"icon":282},"Auto Imports","\u002Fexamples\u002Fauto-imports","4.examples\u002Fauto-imports","i-lucide-import",{"title":284,"path":285,"stem":286,"icon":287},"Cached Handler","\u002Fexamples\u002Fcached-handler","4.examples\u002Fcached-handler","i-lucide-clock",{"title":289,"path":290,"stem":291,"icon":292},"Custom Error Handler","\u002Fexamples\u002Fcustom-error-handler","4.examples\u002Fcustom-error-handler","i-lucide-alert-circle",{"title":38,"path":294,"stem":295,"icon":296},"\u002Fexamples\u002Fdatabase","4.examples\u002Fdatabase","i-lucide-database",{"title":298,"path":299,"stem":300,"icon":301},"Elysia","\u002Fexamples\u002Felysia","4.examples\u002Felysia","i-skill-icons-elysia-dark",{"title":303,"path":304,"stem":305,"icon":306},"Express","\u002Fexamples\u002Fexpress","4.examples\u002Fexpress","i-simple-icons-express",{"title":308,"path":309,"stem":310,"icon":311},"Fastify","\u002Fexamples\u002Ffastify","4.examples\u002Ffastify","i-simple-icons-fastify",{"title":313,"path":314,"stem":315,"icon":316},"Hello World","\u002Fexamples\u002Fhello-world","4.examples\u002Fhello-world","i-lucide-sparkles",{"title":318,"path":319,"stem":320,"icon":321},"Hono","\u002Fexamples\u002Fhono","4.examples\u002Fhono","i-logos-hono",{"title":323,"path":324,"stem":325,"icon":326},"Import Alias","\u002Fexamples\u002Fimport-alias","4.examples\u002Fimport-alias","i-lucide-at-sign",{"title":328,"path":329,"stem":330,"icon":46},"Middleware","\u002Fexamples\u002Fmiddleware","4.examples\u002Fmiddleware",{"title":332,"path":333,"stem":334,"icon":335},"Mono JSX","\u002Fexamples\u002Fmono-jsx","4.examples\u002Fmono-jsx","i-lucide-brackets",{"title":337,"path":338,"stem":339,"icon":335},"Nano JSX","\u002Fexamples\u002Fnano-jsx","4.examples\u002Fnano-jsx",{"title":53,"path":341,"stem":342,"icon":343},"\u002Fexamples\u002Fplugins","4.examples\u002Fplugins","i-lucide-plug",{"title":345,"path":346,"stem":347,"icon":348},"Custom Renderer","\u002Fexamples\u002Frenderer","4.examples\u002Frenderer","i-lucide-code",{"title":350,"path":351,"stem":352,"icon":353},"Runtime Config","\u002Fexamples\u002Fruntime-config","4.examples\u002Fruntime-config","i-lucide-settings",{"title":355,"path":356,"stem":357,"icon":358},"Server Fetch","\u002Fexamples\u002Fserver-fetch","4.examples\u002Fserver-fetch","i-lucide-arrow-right-left",{"title":360,"path":361,"stem":362,"icon":363},"Shiki","\u002Fexamples\u002Fshiki","4.examples\u002Fshiki","i-lucide-highlighter",{"title":365,"path":366,"stem":367,"icon":368},"Takumi","\u002Fexamples\u002Ftakumi","4.examples\u002Ftakumi","i-lucide-image",{"title":370,"path":371,"stem":372,"icon":373},"Tracing","\u002Fexamples\u002Ftracing","4.examples\u002Ftracing","i-lucide-activity",{"title":375,"path":376,"stem":377,"icon":378},"Virtual Routes","\u002Fexamples\u002Fvirtual-routes","4.examples\u002Fvirtual-routes","i-lucide-box",{"title":380,"path":381,"stem":382,"icon":91},"Vite Nitro Plugin","\u002Fexamples\u002Fvite-nitro-plugin","4.examples\u002Fvite-nitro-plugin",{"title":384,"path":385,"stem":386,"icon":387},"Vite RSC","\u002Fexamples\u002Fvite-rsc","4.examples\u002Fvite-rsc","i-logos-react",{"title":389,"path":390,"stem":391,"icon":392},"Vite SSR HTML","\u002Fexamples\u002Fvite-ssr-html","4.examples\u002Fvite-ssr-html","i-logos-html-5",{"title":394,"path":395,"stem":396,"icon":397},"SSR with Preact","\u002Fexamples\u002Fvite-ssr-preact","4.examples\u002Fvite-ssr-preact","i-logos-preact",{"title":399,"path":400,"stem":401,"icon":387},"SSR with React","\u002Fexamples\u002Fvite-ssr-react","4.examples\u002Fvite-ssr-react",{"title":403,"path":404,"stem":405,"icon":406},"SSR with SolidJS","\u002Fexamples\u002Fvite-ssr-solid","4.examples\u002Fvite-ssr-solid","i-logos-solidjs-icon",{"title":408,"path":409,"stem":410,"icon":411},"SSR with TanStack Router","\u002Fexamples\u002Fvite-ssr-tsr-react","4.examples\u002Fvite-ssr-tsr-react","i-simple-icons-tanstack",{"title":413,"path":414,"stem":415,"icon":411},"SSR with TanStack Start","\u002Fexamples\u002Fvite-ssr-tss-react","4.examples\u002Fvite-ssr-tss-react",{"title":417,"path":418,"stem":419,"icon":420},"SSR with Vue Router","\u002Fexamples\u002Fvite-ssr-vue-router","4.examples\u002Fvite-ssr-vue-router","i-logos-vue",{"title":422,"path":423,"stem":424,"icon":425},"Vite + tRPC","\u002Fexamples\u002Fvite-trpc","4.examples\u002Fvite-trpc","i-simple-icons-trpc",{"title":68,"path":427,"stem":428,"icon":429},"\u002Fexamples\u002Fwebsocket","4.examples\u002Fwebsocket","i-lucide-radio",{"title":431,"path":432,"stem":433,"children":434},"Blog","\u002Fblog","9.blog",[435,438],{"title":431,"path":432,"stem":436,"icon":437},"9.blog\u002Findex","i-lucide-file-text",{"title":439,"path":440,"stem":441,"icon":437},"Nitro v3 Beta is here!","\u002Fblog\u002Fv3-beta","9.blog\u002F1.v3-beta",{"title":5,"path":443,"stem":444},"\u002F","index",{"id":446,"title":63,"body":447,"description":2167,"extension":2168,"meta":2169,"navigation":2170,"path":64,"seo":2171,"stem":65,"__hash__":2172},"content\u002F1.docs\u002F50.tasks.md",{"type":448,"value":449,"toc":2145,"icon":66},"minimark",[450,455,470,473,557,561,568,583,589,720,725,732,771,881,886,894,929,982,986,989,1079,1090,1094,1097,1177,1183,1195,1209,1230,1234,1319,1324,1327,1339,1437,1441,1452,1456,1585,1589,1594,1608,1614,1618,1621,1625,1632,1635,1764,1770,1776,2039,2044,2048,2057,2061,2079,2083,2106,2112,2123,2127,2131,2141],[451,452,454],"h2",{"id":453},"opt-in-to-the-experimental-feature","Opt-in to the experimental feature",[456,457,458],"important",{},[459,460,461,462,469],"p",{},"Tasks support is currently experimental.\nSee ",[463,464,468],"a",{"href":465,"rel":466},"https:\u002F\u002Fgithub.com\u002Fnitrojs\u002Fnitro\u002Fissues\u002F1974",[467],"nofollow","nitrojs\u002Fnitro#1974"," for the relevant discussion.",[459,471,472],{},"In order to use the tasks API you need to enable the experimental feature flag.",[474,475,480],"pre",{"className":476,"code":477,"filename":478,"language":479,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  experimental: {\n    tasks: true\n  }\n})\n","nitro.config.ts","ts",[481,482,483,506,513,529,535,545,551],"code",{"__ignoreMap":5},[484,485,488,492,496,499,503],"span",{"class":486,"line":487},"line",1,[484,489,491],{"class":490},"so5gQ","import",[484,493,495],{"class":494},"slsVL"," { defineConfig } ",[484,497,498],{"class":490},"from",[484,500,502],{"class":501},"sfrk1"," \"nitro\"",[484,504,505],{"class":494},";\n",[484,507,509],{"class":486,"line":508},2,[484,510,512],{"emptyLinePlaceholder":511},true,"\n",[484,514,516,519,522,526],{"class":486,"line":515},3,[484,517,518],{"class":490},"export",[484,520,521],{"class":490}," default",[484,523,525],{"class":524},"shcOC"," defineConfig",[484,527,528],{"class":494},"({\n",[484,530,532],{"class":486,"line":531},4,[484,533,534],{"class":494},"  experimental: {\n",[484,536,538,541],{"class":486,"line":537},5,[484,539,540],{"class":494},"    tasks: ",[484,542,544],{"class":543},"suiK_","true\n",[484,546,548],{"class":486,"line":547},6,[484,549,550],{"class":494},"  }\n",[484,552,554],{"class":486,"line":553},7,[484,555,556],{"class":494},"})\n",[451,558,560],{"id":559},"define-tasks","Define tasks",[459,562,563,564,567],{},"Tasks can be defined in ",[481,565,566],{},"tasks\u002F[name].ts"," files.",[459,569,570,571,574,575,578,579,582],{},"Nested directories are supported. The task name will be joined with ",[481,572,573],{},":",". (Example: ",[481,576,577],{},"tasks\u002Fdb\u002Fmigrate.ts"," task name will be ",[481,580,581],{},"db:migrate",")",[459,584,585],{},[586,587,588],"strong",{},"Example:",[474,590,592],{"className":476,"code":591,"filename":577,"language":479,"meta":5,"style":5},"import { defineTask } from \"nitro\u002Ftask\";\n\nexport default defineTask({\n  meta: {\n    name: \"db:migrate\",\n    description: \"Run database migrations\",\n  },\n  run({ payload, context }) {\n    console.log(\"Running DB migration task...\");\n    return { result: \"Success\" };\n  },\n});\n",[481,593,594,608,612,623,628,639,649,654,676,694,709,714],{"__ignoreMap":5},[484,595,596,598,601,603,606],{"class":486,"line":487},[484,597,491],{"class":490},[484,599,600],{"class":494}," { defineTask } ",[484,602,498],{"class":490},[484,604,605],{"class":501}," \"nitro\u002Ftask\"",[484,607,505],{"class":494},[484,609,610],{"class":486,"line":508},[484,611,512],{"emptyLinePlaceholder":511},[484,613,614,616,618,621],{"class":486,"line":515},[484,615,518],{"class":490},[484,617,521],{"class":490},[484,619,620],{"class":524}," defineTask",[484,622,528],{"class":494},[484,624,625],{"class":486,"line":531},[484,626,627],{"class":494},"  meta: {\n",[484,629,630,633,636],{"class":486,"line":537},[484,631,632],{"class":494},"    name: ",[484,634,635],{"class":501},"\"db:migrate\"",[484,637,638],{"class":494},",\n",[484,640,641,644,647],{"class":486,"line":547},[484,642,643],{"class":494},"    description: ",[484,645,646],{"class":501},"\"Run database migrations\"",[484,648,638],{"class":494},[484,650,651],{"class":486,"line":553},[484,652,653],{"class":494},"  },\n",[484,655,657,660,663,667,670,673],{"class":486,"line":656},8,[484,658,659],{"class":524},"  run",[484,661,662],{"class":494},"({ ",[484,664,666],{"class":665},"sQHwn","payload",[484,668,669],{"class":494},", ",[484,671,672],{"class":665},"context",[484,674,675],{"class":494}," }) {\n",[484,677,679,682,685,688,691],{"class":486,"line":678},9,[484,680,681],{"class":494},"    console.",[484,683,684],{"class":524},"log",[484,686,687],{"class":494},"(",[484,689,690],{"class":501},"\"Running DB migration task...\"",[484,692,693],{"class":494},");\n",[484,695,697,700,703,706],{"class":486,"line":696},10,[484,698,699],{"class":490},"    return",[484,701,702],{"class":494}," { result: ",[484,704,705],{"class":501},"\"Success\"",[484,707,708],{"class":494}," };\n",[484,710,712],{"class":486,"line":711},11,[484,713,653],{"class":494},[484,715,717],{"class":486,"line":716},12,[484,718,719],{"class":494},"});\n",[721,722,724],"h3",{"id":723},"task-interface","Task interface",[459,726,727,728,731],{},"The ",[481,729,730],{},"defineTask"," helper accepts an object with the following properties:",[733,734,735,752],"ul",{},[736,737,738,743,744,747,748,751],"li",{},[586,739,740],{},[481,741,742],{},"meta"," (optional): An object with optional ",[481,745,746],{},"name"," and ",[481,749,750],{},"description"," string fields used for display in the dev server and CLI.",[736,753,754,759,760,766,767,770],{},[586,755,756],{},[481,757,758],{},"run"," (required): A function that receives a ",[463,761,763],{"href":762},"#taskevent",[481,764,765],{},"TaskEvent"," and returns (or resolves to) an object with an optional ",[481,768,769],{},"result"," property.",[474,772,774],{"className":476,"code":773,"language":479,"meta":5,"style":5},"interface Task\u003CRT = unknown> {\n  meta?: { name?: string; description?: string };\n  run(event: TaskEvent): { result?: RT } | Promise\u003C{ result?: RT }>;\n}\n",[481,775,776,799,828,876],{"__ignoreMap":5},[484,777,778,781,784,787,790,793,796],{"class":486,"line":487},[484,779,780],{"class":490},"interface",[484,782,783],{"class":524}," Task",[484,785,786],{"class":494},"\u003C",[484,788,789],{"class":524},"RT",[484,791,792],{"class":490}," =",[484,794,795],{"class":543}," unknown",[484,797,798],{"class":494},"> {\n",[484,800,801,804,807,810,812,814,817,820,822,824,826],{"class":486,"line":508},[484,802,803],{"class":665},"  meta",[484,805,806],{"class":490},"?:",[484,808,809],{"class":494}," { ",[484,811,746],{"class":665},[484,813,806],{"class":490},[484,815,816],{"class":543}," string",[484,818,819],{"class":494},"; ",[484,821,750],{"class":665},[484,823,806],{"class":490},[484,825,816],{"class":543},[484,827,708],{"class":494},[484,829,830,832,834,837,839,842,844,846,848,850,852,855,858,861,864,867,869,871,873],{"class":486,"line":515},[484,831,659],{"class":524},[484,833,687],{"class":494},[484,835,836],{"class":665},"event",[484,838,573],{"class":490},[484,840,841],{"class":524}," TaskEvent",[484,843,582],{"class":494},[484,845,573],{"class":490},[484,847,809],{"class":494},[484,849,769],{"class":665},[484,851,806],{"class":490},[484,853,854],{"class":524}," RT",[484,856,857],{"class":494}," } ",[484,859,860],{"class":490},"|",[484,862,863],{"class":524}," Promise",[484,865,866],{"class":494},"\u003C{ ",[484,868,769],{"class":665},[484,870,806],{"class":490},[484,872,854],{"class":524},[484,874,875],{"class":494}," }>;\n",[484,877,878],{"class":486,"line":531},[484,879,880],{"class":494},"}\n",[721,882,884],{"id":883},"taskevent",[481,885,765],{},[459,887,727,888,890,891,893],{},[481,889,758],{}," function receives a ",[481,892,765],{}," object with the following properties:",[733,895,896,903,914],{},[736,897,898,902],{},[586,899,900],{},[481,901,746],{},": The name of the task being executed.",[736,904,905,909,910,913],{},[586,906,907],{},[481,908,666],{},": An object (",[481,911,912],{},"Record\u003Cstring, unknown>",") containing any data passed to the task.",[736,915,916,920,921,924,925,928],{},[586,917,918],{},[481,919,672],{},": A ",[481,922,923],{},"TaskContext"," object (may include ",[481,926,927],{},"waitUntil"," depending on the runtime).",[474,930,932],{"className":476,"code":931,"language":479,"meta":5,"style":5},"interface TaskEvent {\n  name: string;\n  payload: TaskPayload;\n  context: TaskContext;\n}\n",[481,933,934,943,954,966,978],{"__ignoreMap":5},[484,935,936,938,940],{"class":486,"line":487},[484,937,780],{"class":490},[484,939,841],{"class":524},[484,941,942],{"class":494}," {\n",[484,944,945,948,950,952],{"class":486,"line":508},[484,946,947],{"class":665},"  name",[484,949,573],{"class":490},[484,951,816],{"class":543},[484,953,505],{"class":494},[484,955,956,959,961,964],{"class":486,"line":515},[484,957,958],{"class":665},"  payload",[484,960,573],{"class":490},[484,962,963],{"class":524}," TaskPayload",[484,965,505],{"class":494},[484,967,968,971,973,976],{"class":486,"line":531},[484,969,970],{"class":665},"  context",[484,972,573],{"class":490},[484,974,975],{"class":524}," TaskContext",[484,977,505],{"class":494},[484,979,980],{"class":486,"line":537},[484,981,880],{"class":494},[721,983,985],{"id":984},"registering-tasks-via-config","Registering tasks via config",[459,987,988],{},"In addition to file-based scanning, tasks can be registered directly in the Nitro config. This is useful for tasks provided by modules or pointing to custom handler paths.",[474,990,992],{"className":476,"code":991,"filename":478,"language":479,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  experimental: {\n    tasks: true\n  },\n  tasks: {\n    \"db:migrate\": {\n      handler: \".\u002Ftasks\u002Fcustom-migrate.ts\",\n      description: \"Run database migrations\"\n    }\n  }\n})\n",[481,993,994,1006,1010,1020,1024,1030,1034,1039,1047,1057,1065,1070,1074],{"__ignoreMap":5},[484,995,996,998,1000,1002,1004],{"class":486,"line":487},[484,997,491],{"class":490},[484,999,495],{"class":494},[484,1001,498],{"class":490},[484,1003,502],{"class":501},[484,1005,505],{"class":494},[484,1007,1008],{"class":486,"line":508},[484,1009,512],{"emptyLinePlaceholder":511},[484,1011,1012,1014,1016,1018],{"class":486,"line":515},[484,1013,518],{"class":490},[484,1015,521],{"class":490},[484,1017,525],{"class":524},[484,1019,528],{"class":494},[484,1021,1022],{"class":486,"line":531},[484,1023,534],{"class":494},[484,1025,1026,1028],{"class":486,"line":537},[484,1027,540],{"class":494},[484,1029,544],{"class":543},[484,1031,1032],{"class":486,"line":547},[484,1033,653],{"class":494},[484,1035,1036],{"class":486,"line":553},[484,1037,1038],{"class":494},"  tasks: {\n",[484,1040,1041,1044],{"class":486,"line":656},[484,1042,1043],{"class":501},"    \"db:migrate\"",[484,1045,1046],{"class":494},": {\n",[484,1048,1049,1052,1055],{"class":486,"line":678},[484,1050,1051],{"class":494},"      handler: ",[484,1053,1054],{"class":501},"\".\u002Ftasks\u002Fcustom-migrate.ts\"",[484,1056,638],{"class":494},[484,1058,1059,1062],{"class":486,"line":696},[484,1060,1061],{"class":494},"      description: ",[484,1063,1064],{"class":501},"\"Run database migrations\"\n",[484,1066,1067],{"class":486,"line":711},[484,1068,1069],{"class":494},"    }\n",[484,1071,1072],{"class":486,"line":716},[484,1073,550],{"class":494},[484,1075,1077],{"class":486,"line":1076},13,[484,1078,556],{"class":494},[459,1080,1081,1082,1085,1086,1089],{},"If a task is both scanned from the ",[481,1083,1084],{},"tasks\u002F"," directory and defined in the config, the config-defined ",[481,1087,1088],{},"handler"," takes precedence.",[451,1091,1093],{"id":1092},"scheduled-tasks","Scheduled tasks",[459,1095,1096],{},"You can define scheduled tasks using Nitro configuration to automatically run after each period of time.",[474,1098,1100],{"className":476,"code":1099,"filename":478,"language":479,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  scheduledTasks: {\n    \u002F\u002F Run `cms:update` task every minute\n    '* * * * *': ['cms:update'],\n    \u002F\u002F Run a single task (string shorthand)\n    '0 * * * *': 'db:cleanup'\n  }\n})\n",[481,1101,1102,1114,1118,1128,1133,1139,1153,1158,1169,1173],{"__ignoreMap":5},[484,1103,1104,1106,1108,1110,1112],{"class":486,"line":487},[484,1105,491],{"class":490},[484,1107,495],{"class":494},[484,1109,498],{"class":490},[484,1111,502],{"class":501},[484,1113,505],{"class":494},[484,1115,1116],{"class":486,"line":508},[484,1117,512],{"emptyLinePlaceholder":511},[484,1119,1120,1122,1124,1126],{"class":486,"line":515},[484,1121,518],{"class":490},[484,1123,521],{"class":490},[484,1125,525],{"class":524},[484,1127,528],{"class":494},[484,1129,1130],{"class":486,"line":531},[484,1131,1132],{"class":494},"  scheduledTasks: {\n",[484,1134,1135],{"class":486,"line":537},[484,1136,1138],{"class":1137},"sCsY4","    \u002F\u002F Run `cms:update` task every minute\n",[484,1140,1141,1144,1147,1150],{"class":486,"line":547},[484,1142,1143],{"class":501},"    '* * * * *'",[484,1145,1146],{"class":494},": [",[484,1148,1149],{"class":501},"'cms:update'",[484,1151,1152],{"class":494},"],\n",[484,1154,1155],{"class":486,"line":553},[484,1156,1157],{"class":1137},"    \u002F\u002F Run a single task (string shorthand)\n",[484,1159,1160,1163,1166],{"class":486,"line":656},[484,1161,1162],{"class":501},"    '0 * * * *'",[484,1164,1165],{"class":494},": ",[484,1167,1168],{"class":501},"'db:cleanup'\n",[484,1170,1171],{"class":486,"line":678},[484,1172,550],{"class":494},[484,1174,1175],{"class":486,"line":696},[484,1176,556],{"class":494},[459,1178,727,1179,1182],{},[481,1180,1181],{},"scheduledTasks"," config maps cron expressions to either a single task name (string) or an array of task names. When multiple tasks are assigned to the same cron expression, they run in parallel.",[1184,1185,1186],"tip",{},[459,1187,1188,1189,1194],{},"You can use ",[463,1190,1193],{"href":1191,"rel":1192},"https:\u002F\u002Fcrontab.guru\u002F",[467],"crontab.guru"," to easily generate and understand cron tab patterns.",[459,1196,1197,1198,1200,1201,1204,1205,1208],{},"When a scheduled task runs, it automatically receives a ",[481,1199,666],{}," with ",[481,1202,1203],{},"scheduledTime"," set to the current timestamp (",[481,1206,1207],{},"Date.now()",").",[1210,1211,1212],"note",{},[459,1213,1214,1215,1217,1218,1222,1223,1229],{},"Prefer ",[481,1216,1181],{}," when your deployment target supports it (see ",[463,1219,1221],{"href":1220},"#platform-support","platform support",") — Nitro wires up the platform's native scheduler for you. If your platform is not supported, you can still trigger tasks from an external scheduler by calling ",[463,1224,1226],{"href":1225},"#programmatically-run-tasks",[481,1227,1228],{},"runTask"," from an authenticated HTTP endpoint.",[721,1231,1233],{"id":1232},"platform-support","Platform support",[733,1235,1236,1275,1294,1316],{},[736,1237,1238,669,1243,669,1248,669,1253,669,1258,747,1263,1268,1269,1274],{},[586,1239,1240],{},[481,1241,1242],{},"dev",[586,1244,1245],{},[481,1246,1247],{},"node_server",[586,1249,1250],{},[481,1251,1252],{},"node_cluster",[586,1254,1255],{},[481,1256,1257],{},"node_middleware",[586,1259,1260],{},[481,1261,1262],{},"bun",[586,1264,1265],{},[481,1266,1267],{},"deno_server"," presets are supported with the ",[463,1270,1273],{"href":1271,"rel":1272},"https:\u002F\u002Fcroner.56k.guru\u002F",[467],"croner"," engine.",[736,1276,1277,747,1282,1287,1288,1293],{},[586,1278,1279],{},[481,1280,1281],{},"cloudflare_module",[586,1283,1284],{},[481,1285,1286],{},"cloudflare_pages"," presets have native integration with ",[463,1289,1292],{"href":1290,"rel":1291},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fconfiguration\u002Fcron-triggers\u002F",[467],"Cron Triggers",". Nitro automatically generates the cron triggers in the wrangler config at build time - no manual wrangler setup required.",[736,1295,1296,1301,1302,1307,1308,1311,1312,1315],{},[586,1297,1298],{},[481,1299,1300],{},"vercel"," preset has native integration with ",[463,1303,1306],{"href":1304,"rel":1305},"https:\u002F\u002Fvercel.com\u002Fdocs\u002Fcron-jobs",[467],"Vercel Cron Jobs",". Nitro automatically generates the cron job configuration at build time - no manual ",[481,1309,1310],{},"vercel.json"," setup required. You can secure cron endpoints by setting the ",[481,1313,1314],{},"CRON_SECRET"," environment variable.",[736,1317,1318],{},"More presets (with native primitives support) are planned to be supported!",[451,1320,1322],{"id":1321},"waituntil",[481,1323,927],{},[459,1325,1326],{},"When running background tasks, you might want to make sure the server or worker waits until the task is done.",[459,1328,1329,1330,1333,1334,1338],{},"An optional ",[481,1331,1332],{},"context.waitUntil"," function ",[1335,1336,1337],"em",{},"might"," be available depending on the runtime.",[474,1340,1342],{"className":476,"code":1341,"language":479,"meta":5,"style":5},"import { defineTask } from \"nitro\u002Ftask\";\n\nexport default defineTask({\n  run({ context }) {\n    const promise = fetch(...)\n    context.waitUntil?.(promise);\n    await promise;\n    return { result: \"Success\" };\n  },\n});\n",[481,1343,1344,1356,1360,1370,1380,1401,1411,1419,1429,1433],{"__ignoreMap":5},[484,1345,1346,1348,1350,1352,1354],{"class":486,"line":487},[484,1347,491],{"class":490},[484,1349,600],{"class":494},[484,1351,498],{"class":490},[484,1353,605],{"class":501},[484,1355,505],{"class":494},[484,1357,1358],{"class":486,"line":508},[484,1359,512],{"emptyLinePlaceholder":511},[484,1361,1362,1364,1366,1368],{"class":486,"line":515},[484,1363,518],{"class":490},[484,1365,521],{"class":490},[484,1367,620],{"class":524},[484,1369,528],{"class":494},[484,1371,1372,1374,1376,1378],{"class":486,"line":531},[484,1373,659],{"class":524},[484,1375,662],{"class":494},[484,1377,672],{"class":665},[484,1379,675],{"class":494},[484,1381,1382,1385,1388,1390,1393,1395,1398],{"class":486,"line":537},[484,1383,1384],{"class":490},"    const",[484,1386,1387],{"class":543}," promise",[484,1389,792],{"class":490},[484,1391,1392],{"class":524}," fetch",[484,1394,687],{"class":494},[484,1396,1397],{"class":490},"...",[484,1399,1400],{"class":494},")\n",[484,1402,1403,1406,1408],{"class":486,"line":547},[484,1404,1405],{"class":494},"    context.",[484,1407,927],{"class":524},[484,1409,1410],{"class":494},"?.(promise);\n",[484,1412,1413,1416],{"class":486,"line":553},[484,1414,1415],{"class":490},"    await",[484,1417,1418],{"class":494}," promise;\n",[484,1420,1421,1423,1425,1427],{"class":486,"line":656},[484,1422,699],{"class":490},[484,1424,702],{"class":494},[484,1426,705],{"class":501},[484,1428,708],{"class":494},[484,1430,1431],{"class":486,"line":678},[484,1432,653],{"class":494},[484,1434,1435],{"class":486,"line":696},[484,1436,719],{"class":494},[451,1438,1440],{"id":1439},"programmatically-run-tasks","Programmatically run tasks",[459,1442,1443,1444,1447,1448,1451],{},"To manually run tasks, you can use ",[481,1445,1446],{},"runTask(name, { payload?, context? })"," utility from ",[481,1449,1450],{},"nitro\u002Ftask",".",[459,1453,1454],{},[586,1455,588],{},[474,1457,1460],{"className":476,"code":1458,"filename":1459,"language":479,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\nimport { runTask } from \"nitro\u002Ftask\";\n\nexport default defineHandler(async (event) => {\n  \u002F\u002F IMPORTANT: Authenticate user and validate payload!\n  const payload = Object.fromEntries(event.url.searchParams);\n  const { result } = await runTask(\"db:migrate\", { payload });\n\n  return { result };\n});\n","api\u002Fmigrate.ts",[481,1461,1462,1475,1488,1492,1519,1524,1543,1569,1573,1581],{"__ignoreMap":5},[484,1463,1464,1466,1469,1471,1473],{"class":486,"line":487},[484,1465,491],{"class":490},[484,1467,1468],{"class":494}," { defineHandler } ",[484,1470,498],{"class":490},[484,1472,502],{"class":501},[484,1474,505],{"class":494},[484,1476,1477,1479,1482,1484,1486],{"class":486,"line":508},[484,1478,491],{"class":490},[484,1480,1481],{"class":494}," { runTask } ",[484,1483,498],{"class":490},[484,1485,605],{"class":501},[484,1487,505],{"class":494},[484,1489,1490],{"class":486,"line":515},[484,1491,512],{"emptyLinePlaceholder":511},[484,1493,1494,1496,1498,1501,1503,1506,1509,1511,1514,1517],{"class":486,"line":531},[484,1495,518],{"class":490},[484,1497,521],{"class":490},[484,1499,1500],{"class":524}," defineHandler",[484,1502,687],{"class":494},[484,1504,1505],{"class":490},"async",[484,1507,1508],{"class":494}," (",[484,1510,836],{"class":665},[484,1512,1513],{"class":494},") ",[484,1515,1516],{"class":490},"=>",[484,1518,942],{"class":494},[484,1520,1521],{"class":486,"line":537},[484,1522,1523],{"class":1137},"  \u002F\u002F IMPORTANT: Authenticate user and validate payload!\n",[484,1525,1526,1529,1532,1534,1537,1540],{"class":486,"line":547},[484,1527,1528],{"class":490},"  const",[484,1530,1531],{"class":543}," payload",[484,1533,792],{"class":490},[484,1535,1536],{"class":494}," Object.",[484,1538,1539],{"class":524},"fromEntries",[484,1541,1542],{"class":494},"(event.url.searchParams);\n",[484,1544,1545,1547,1549,1551,1553,1556,1559,1562,1564,1566],{"class":486,"line":553},[484,1546,1528],{"class":490},[484,1548,809],{"class":494},[484,1550,769],{"class":543},[484,1552,857],{"class":494},[484,1554,1555],{"class":490},"=",[484,1557,1558],{"class":490}," await",[484,1560,1561],{"class":524}," runTask",[484,1563,687],{"class":494},[484,1565,635],{"class":501},[484,1567,1568],{"class":494},", { payload });\n",[484,1570,1571],{"class":486,"line":656},[484,1572,512],{"emptyLinePlaceholder":511},[484,1574,1575,1578],{"class":486,"line":678},[484,1576,1577],{"class":490},"  return",[484,1579,1580],{"class":494}," { result };\n",[484,1582,1583],{"class":486,"line":696},[484,1584,719],{"class":494},[721,1586,1588],{"id":1587},"error-handling","Error handling",[459,1590,1591,1593],{},[481,1592,1228],{}," throws an HTTP error if:",[733,1595,1596,1602],{},[736,1597,1598,1599,1208],{},"The task does not exist (status ",[481,1600,1601],{},"404",[736,1603,1604,1605,1208],{},"The task has no handler implementation (status ",[481,1606,1607],{},"501",[459,1609,1610,1611,1613],{},"Any errors thrown inside the task's ",[481,1612,758],{}," function will propagate to the caller.",[451,1615,1617],{"id":1616},"run-tasks-with-dev-server","Run tasks with dev server",[459,1619,1620],{},"Nitro's built-in dev server exposes tasks to be easily executed without programmatic usage.",[721,1622,1624],{"id":1623},"using-api-routes","Using API routes",[1626,1627,1629],"h4",{"id":1628},"_nitrotasks",[481,1630,1631],{},"\u002F_nitro\u002Ftasks",[459,1633,1634],{},"This endpoint returns a list of available task names and their meta.",[474,1636,1640],{"className":1637,"code":1638,"language":1639,"meta":5,"style":5},"language-json shiki shiki-themes github-light github-dark github-dark","\u002F\u002F [GET] \u002F_nitro\u002Ftasks\n{\n  \"tasks\": {\n    \"db:migrate\": {\n      \"description\": \"Run database migrations\"\n    },\n     \"cms:update\": {\n      \"description\": \"Update CMS content\"\n    }\n  },\n  \"scheduledTasks\": [\n    {\n      \"cron\": \"* * * * *\",\n      \"tasks\": [\n        \"cms:update\"\n      ]\n    }\n  ]\n}\n","json",[481,1641,1642,1647,1652,1659,1665,1674,1679,1686,1695,1699,1703,1711,1716,1728,1736,1742,1748,1753,1759],{"__ignoreMap":5},[484,1643,1644],{"class":486,"line":487},[484,1645,1646],{"class":1137},"\u002F\u002F [GET] \u002F_nitro\u002Ftasks\n",[484,1648,1649],{"class":486,"line":508},[484,1650,1651],{"class":494},"{\n",[484,1653,1654,1657],{"class":486,"line":515},[484,1655,1656],{"class":543},"  \"tasks\"",[484,1658,1046],{"class":494},[484,1660,1661,1663],{"class":486,"line":531},[484,1662,1043],{"class":543},[484,1664,1046],{"class":494},[484,1666,1667,1670,1672],{"class":486,"line":537},[484,1668,1669],{"class":543},"      \"description\"",[484,1671,1165],{"class":494},[484,1673,1064],{"class":501},[484,1675,1676],{"class":486,"line":547},[484,1677,1678],{"class":494},"    },\n",[484,1680,1681,1684],{"class":486,"line":553},[484,1682,1683],{"class":543},"     \"cms:update\"",[484,1685,1046],{"class":494},[484,1687,1688,1690,1692],{"class":486,"line":656},[484,1689,1669],{"class":543},[484,1691,1165],{"class":494},[484,1693,1694],{"class":501},"\"Update CMS content\"\n",[484,1696,1697],{"class":486,"line":678},[484,1698,1069],{"class":494},[484,1700,1701],{"class":486,"line":696},[484,1702,653],{"class":494},[484,1704,1705,1708],{"class":486,"line":711},[484,1706,1707],{"class":543},"  \"scheduledTasks\"",[484,1709,1710],{"class":494},": [\n",[484,1712,1713],{"class":486,"line":716},[484,1714,1715],{"class":494},"    {\n",[484,1717,1718,1721,1723,1726],{"class":486,"line":1076},[484,1719,1720],{"class":543},"      \"cron\"",[484,1722,1165],{"class":494},[484,1724,1725],{"class":501},"\"* * * * *\"",[484,1727,638],{"class":494},[484,1729,1731,1734],{"class":486,"line":1730},14,[484,1732,1733],{"class":543},"      \"tasks\"",[484,1735,1710],{"class":494},[484,1737,1739],{"class":486,"line":1738},15,[484,1740,1741],{"class":501},"        \"cms:update\"\n",[484,1743,1745],{"class":486,"line":1744},16,[484,1746,1747],{"class":494},"      ]\n",[484,1749,1751],{"class":486,"line":1750},17,[484,1752,1069],{"class":494},[484,1754,1756],{"class":486,"line":1755},18,[484,1757,1758],{"class":494},"  ]\n",[484,1760,1762],{"class":486,"line":1761},19,[484,1763,880],{"class":494},[1626,1765,1767],{"id":1766},"_nitrotasksname",[481,1768,1769],{},"\u002F_nitro\u002Ftasks\u002F:name",[459,1771,1772,1773,770],{},"This endpoint executes a task. You can provide a payload using both query parameters and body JSON payload. The payload sent in the JSON body payload must be under the ",[481,1774,1775],{},"\"payload\"",[1777,1778,1779,1879,1928],"code-group",{},[474,1780,1783],{"className":476,"code":1781,"filename":1782,"language":479,"meta":5,"style":5},"import { defineTask } from \"nitro\u002Ftask\";\n\nexport default defineTask({\n  meta: {\n    name: \"echo:payload\",\n    description: \"Returns the provided payload\",\n  },\n  run({ payload, context }) {\n    console.log(\"Running echo task...\");\n    return { result: payload };\n  },\n});\n","tasks\u002Fecho\u002Fpayload.ts",[481,1784,1785,1797,1801,1811,1815,1824,1833,1837,1851,1864,1871,1875],{"__ignoreMap":5},[484,1786,1787,1789,1791,1793,1795],{"class":486,"line":487},[484,1788,491],{"class":490},[484,1790,600],{"class":494},[484,1792,498],{"class":490},[484,1794,605],{"class":501},[484,1796,505],{"class":494},[484,1798,1799],{"class":486,"line":508},[484,1800,512],{"emptyLinePlaceholder":511},[484,1802,1803,1805,1807,1809],{"class":486,"line":515},[484,1804,518],{"class":490},[484,1806,521],{"class":490},[484,1808,620],{"class":524},[484,1810,528],{"class":494},[484,1812,1813],{"class":486,"line":531},[484,1814,627],{"class":494},[484,1816,1817,1819,1822],{"class":486,"line":537},[484,1818,632],{"class":494},[484,1820,1821],{"class":501},"\"echo:payload\"",[484,1823,638],{"class":494},[484,1825,1826,1828,1831],{"class":486,"line":547},[484,1827,643],{"class":494},[484,1829,1830],{"class":501},"\"Returns the provided payload\"",[484,1832,638],{"class":494},[484,1834,1835],{"class":486,"line":553},[484,1836,653],{"class":494},[484,1838,1839,1841,1843,1845,1847,1849],{"class":486,"line":656},[484,1840,659],{"class":524},[484,1842,662],{"class":494},[484,1844,666],{"class":665},[484,1846,669],{"class":494},[484,1848,672],{"class":665},[484,1850,675],{"class":494},[484,1852,1853,1855,1857,1859,1862],{"class":486,"line":678},[484,1854,681],{"class":494},[484,1856,684],{"class":524},[484,1858,687],{"class":494},[484,1860,1861],{"class":501},"\"Running echo task...\"",[484,1863,693],{"class":494},[484,1865,1866,1868],{"class":486,"line":696},[484,1867,699],{"class":490},[484,1869,1870],{"class":494}," { result: payload };\n",[484,1872,1873],{"class":486,"line":711},[484,1874,653],{"class":494},[484,1876,1877],{"class":486,"line":716},[484,1878,719],{"class":494},[474,1880,1883],{"className":1637,"code":1881,"filename":1882,"language":1639,"meta":5,"style":5},"\u002F\u002F [GET] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value&array=1&array=2\n{\n  \"field\": \"value\",\n  \"array\": [\"1\", \"2\"]\n}\n","GET",[481,1884,1885,1890,1894,1906,1924],{"__ignoreMap":5},[484,1886,1887],{"class":486,"line":487},[484,1888,1889],{"class":1137},"\u002F\u002F [GET] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value&array=1&array=2\n",[484,1891,1892],{"class":486,"line":508},[484,1893,1651],{"class":494},[484,1895,1896,1899,1901,1904],{"class":486,"line":515},[484,1897,1898],{"class":543},"  \"field\"",[484,1900,1165],{"class":494},[484,1902,1903],{"class":501},"\"value\"",[484,1905,638],{"class":494},[484,1907,1908,1911,1913,1916,1918,1921],{"class":486,"line":531},[484,1909,1910],{"class":543},"  \"array\"",[484,1912,1146],{"class":494},[484,1914,1915],{"class":501},"\"1\"",[484,1917,669],{"class":494},[484,1919,1920],{"class":501},"\"2\"",[484,1922,1923],{"class":494},"]\n",[484,1925,1926],{"class":486,"line":537},[484,1927,880],{"class":494},[474,1929,1932],{"className":1637,"code":1930,"filename":1931,"language":1639,"meta":5,"style":5},"\u002F**\n * [POST] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value\n * body: {\n *   \"payload\": {\n *     \"answer\": 42,\n *     \"nested\": {\n *       \"value\": true\n *     }\n *   }\n * }\n *\u002F\n{\n  \"field\": \"value\",\n  \"answer\": 42,\n  \"nested\": {\n    \"value\": true\n  }\n}\n","POST",[481,1933,1934,1939,1944,1949,1954,1959,1964,1969,1974,1979,1984,1989,1993,2003,2015,2022,2031,2035],{"__ignoreMap":5},[484,1935,1936],{"class":486,"line":487},[484,1937,1938],{"class":1137},"\u002F**\n",[484,1940,1941],{"class":486,"line":508},[484,1942,1943],{"class":1137}," * [POST] \u002F_nitro\u002Ftasks\u002Fecho:payload?field=value\n",[484,1945,1946],{"class":486,"line":515},[484,1947,1948],{"class":1137}," * body: {\n",[484,1950,1951],{"class":486,"line":531},[484,1952,1953],{"class":1137}," *   \"payload\": {\n",[484,1955,1956],{"class":486,"line":537},[484,1957,1958],{"class":1137}," *     \"answer\": 42,\n",[484,1960,1961],{"class":486,"line":547},[484,1962,1963],{"class":1137}," *     \"nested\": {\n",[484,1965,1966],{"class":486,"line":553},[484,1967,1968],{"class":1137}," *       \"value\": true\n",[484,1970,1971],{"class":486,"line":656},[484,1972,1973],{"class":1137}," *     }\n",[484,1975,1976],{"class":486,"line":678},[484,1977,1978],{"class":1137}," *   }\n",[484,1980,1981],{"class":486,"line":696},[484,1982,1983],{"class":1137}," * }\n",[484,1985,1986],{"class":486,"line":711},[484,1987,1988],{"class":1137}," *\u002F\n",[484,1990,1991],{"class":486,"line":716},[484,1992,1651],{"class":494},[484,1994,1995,1997,1999,2001],{"class":486,"line":1076},[484,1996,1898],{"class":543},[484,1998,1165],{"class":494},[484,2000,1903],{"class":501},[484,2002,638],{"class":494},[484,2004,2005,2008,2010,2013],{"class":486,"line":1730},[484,2006,2007],{"class":543},"  \"answer\"",[484,2009,1165],{"class":494},[484,2011,2012],{"class":543},"42",[484,2014,638],{"class":494},[484,2016,2017,2020],{"class":486,"line":1738},[484,2018,2019],{"class":543},"  \"nested\"",[484,2021,1046],{"class":494},[484,2023,2024,2027,2029],{"class":486,"line":1744},[484,2025,2026],{"class":543},"    \"value\"",[484,2028,1165],{"class":494},[484,2030,544],{"class":543},[484,2032,2033],{"class":486,"line":1750},[484,2034,550],{"class":494},[484,2036,2037],{"class":486,"line":1755},[484,2038,880],{"class":494},[1210,2040,2041],{},[459,2042,2043],{},"The JSON payload included in the body will overwrite the keys present in the query params.",[721,2045,2047],{"id":2046},"using-cli","Using CLI",[456,2049,2050],{},[459,2051,2052,2053,2056],{},"It is only possible to run these commands while the ",[586,2054,2055],{},"dev server is running",". You should run them in a second terminal.",[1626,2058,2060],{"id":2059},"list-tasks","List tasks",[474,2062,2066],{"className":2063,"code":2064,"language":2065,"meta":5,"style":5},"language-sh shiki shiki-themes github-light github-dark github-dark","nitro task list\n","sh",[481,2067,2068],{"__ignoreMap":5},[484,2069,2070,2073,2076],{"class":486,"line":487},[484,2071,2072],{"class":524},"nitro",[484,2074,2075],{"class":501}," task",[484,2077,2078],{"class":501}," list\n",[1626,2080,2082],{"id":2081},"run-a-task","Run a task",[474,2084,2086],{"className":2063,"code":2085,"language":2065,"meta":5,"style":5},"nitro task run db:migrate --payload \"{}\"\n",[481,2087,2088],{"__ignoreMap":5},[484,2089,2090,2092,2094,2097,2100,2103],{"class":486,"line":487},[484,2091,2072],{"class":524},[484,2093,2075],{"class":501},[484,2095,2096],{"class":501}," run",[484,2098,2099],{"class":501}," db:migrate",[484,2101,2102],{"class":543}," --payload",[484,2104,2105],{"class":501}," \"{}\"\n",[459,2107,727,2108,2111],{},[481,2109,2110],{},"--payload"," flag accepts a JSON string that will be parsed and passed to the task. If the value is not a valid JSON object, the task runs without a payload.",[2113,2114,2116],"read-more",{"to":2115},"\u002Fdocs\u002Fcli#nitro-task",[459,2117,2118,2119,2122],{},"See the CLI reference for all ",[481,2120,2121],{},"nitro task"," subcommands and flags.",[451,2124,2126],{"id":2125},"notes","Notes",[721,2128,2130],{"id":2129},"concurrency","Concurrency",[459,2132,2133,2134,2137,2138,2140],{},"Task runs are deduplicated by ",[586,2135,2136],{},"task name",": each task can have at most one running instance per server instance. Calling ",[481,2139,1228],{}," for a task that is already running does not start a new run — all concurrent callers, even those passing different payloads, share the result of the first in-flight run.",[2142,2143,2144],"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 .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}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":5,"searchDepth":508,"depth":508,"links":2146},[2147,2148,2153,2156,2157,2160,2164],{"id":453,"depth":508,"text":454},{"id":559,"depth":508,"text":560,"children":2149},[2150,2151,2152],{"id":723,"depth":515,"text":724},{"id":883,"depth":515,"text":765},{"id":984,"depth":515,"text":985},{"id":1092,"depth":508,"text":1093,"children":2154},[2155],{"id":1232,"depth":515,"text":1233},{"id":1321,"depth":508,"text":927},{"id":1439,"depth":508,"text":1440,"children":2158},[2159],{"id":1587,"depth":515,"text":1588},{"id":1616,"depth":508,"text":1617,"children":2161},[2162,2163],{"id":1623,"depth":515,"text":1624},{"id":2046,"depth":515,"text":2047},{"id":2125,"depth":508,"text":2126,"children":2165},[2166],{"id":2129,"depth":515,"text":2130},"Nitro tasks allow one-off operations at runtime: named server-side actions such as database migrations, cache cleanup, or content syncing that you can run on demand, on a schedule, or from the CLI.","md",{"icon":66},{"icon":66},{"title":63,"description":2167},"v3XYW34Yid75rzG7NLiQfnx7ysE0ssZaBcnSfy20z7o",[2174,2176],{"title":58,"path":59,"stem":60,"description":2175,"icon":61,"children":-1},"Render routes at build time and serve them as static assets.",{"title":68,"path":69,"stem":70,"description":2177,"icon":71,"children":-1},"Nitro provides cross-platform WebSocket support powered by CrossWS and H3.",1784019071927]