[{"data":1,"prerenderedAt":1125},["ShallowReactive",2],{"navigation":3,"examples-nav":377,"-examples-plugins":478,"-examples-plugins-surround":1122},[4,83,212,218,374],{"title":5,"path":6,"stem":7,"children":8,"icon":82},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":63,"path":64,"stem":65,"icon":66},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":68,"path":69,"stem":70,"icon":71},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":73,"path":74,"stem":75,"icon":76},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":78,"path":79,"stem":80,"icon":81},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":84,"path":85,"stem":86,"children":87,"icon":89},"Deploy","/deploy","2.deploy/0.index",[88,90,111],{"title":84,"path":85,"stem":86,"icon":89},"ri:upload-cloud-2-line",{"title":91,"path":92,"stem":93,"children":94,"page":110},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[95,100,105],{"title":96,"path":97,"stem":98,"icon":99},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":101,"path":102,"stem":103,"icon":104},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":106,"path":107,"stem":108,"icon":109},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":112,"path":113,"stem":114,"children":115,"page":110},"Providers","/deploy/providers","2.deploy/20.providers",[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208],{"title":117,"path":118,"stem":119},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":121,"path":122,"stem":123},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":125,"path":126,"stem":127},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":129,"path":130,"stem":131},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":133,"path":134,"stem":135},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":137,"path":138,"stem":139},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":141,"path":142,"stem":143},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":145,"path":146,"stem":147},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":149,"path":150,"stem":151},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":153,"path":154,"stem":155},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":157,"path":158,"stem":159},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":161,"path":162,"stem":163},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":165,"path":166,"stem":167},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":169,"path":170,"stem":171},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":173,"path":174,"stem":175},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":177,"path":178,"stem":179},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":181,"path":182,"stem":183},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":185,"path":186,"stem":187},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":189,"path":190,"stem":191},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":193,"path":194,"stem":195},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":197,"path":198,"stem":199},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":201,"path":202,"stem":203},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":205,"path":206,"stem":207},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":209,"path":210,"stem":211},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":213,"path":214,"stem":215,"children":216,"icon":36},"Config","/config","3.config/0.index",[217],{"title":213,"path":214,"stem":215,"icon":36},{"title":219,"path":220,"stem":221,"children":222,"icon":224},"Examples","/examples","4.examples/0.index",[223,225,230,235,240,245,249,254,259,264,269,274,279,283,288,292,296,301,306,311,316,321,326,331,336,341,345,350,355,359,364,369],{"title":219,"path":220,"stem":221,"icon":224},"i-lucide-folder-code",{"title":226,"path":227,"stem":228,"icon":229},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":231,"path":232,"stem":233,"icon":234},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":236,"path":237,"stem":238,"icon":239},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":241,"path":242,"stem":243,"icon":244},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":246,"stem":247,"icon":248},"/examples/database","4.examples/database","i-lucide-database",{"title":250,"path":251,"stem":252,"icon":253},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":255,"path":256,"stem":257,"icon":258},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":260,"path":261,"stem":262,"icon":263},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":265,"path":266,"stem":267,"icon":268},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":270,"path":271,"stem":272,"icon":273},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":275,"path":276,"stem":277,"icon":278},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":280,"path":281,"stem":282,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":284,"path":285,"stem":286,"icon":287},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":289,"path":290,"stem":291,"icon":287},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":48,"path":293,"stem":294,"icon":295},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":297,"path":298,"stem":299,"icon":300},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":302,"path":303,"stem":304,"icon":305},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":307,"path":308,"stem":309,"icon":310},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":312,"path":313,"stem":314,"icon":315},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":317,"path":318,"stem":319,"icon":320},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":322,"path":323,"stem":324,"icon":325},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":327,"path":328,"stem":329,"icon":330},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":332,"path":333,"stem":334,"icon":335},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":337,"path":338,"stem":339,"icon":340},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":342,"path":343,"stem":344,"icon":330},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":346,"path":347,"stem":348,"icon":349},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":351,"path":352,"stem":353,"icon":354},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":356,"path":357,"stem":358,"icon":354},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":360,"path":361,"stem":362,"icon":363},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":365,"path":366,"stem":367,"icon":368},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":370,"path":371,"stem":372,"icon":373},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":5,"path":375,"stem":376},"/","index",[378,383,387,390,393,396,400,403,406,409,412,415,418,422,425,428,431,434,437,441,444,448,451,454,457,460,463,466,469,472,475],{"title":226,"description":379,"meta":380,"path":227},"File-based API routing with HTTP method support and dynamic parameters.",{"automd":381,"category":382,"icon":229},true,"features",{"title":231,"description":384,"meta":385,"path":232},"Automatic imports for utilities and composables.",{"automd":381,"category":386,"icon":234},"config",{"title":236,"description":388,"meta":389,"path":237},"Cache route responses with configurable bypass logic.",{"automd":381,"category":382,"icon":239},{"title":241,"description":391,"meta":392,"path":242},"Customize error responses with a global error handler.",{"automd":381,"category":382,"icon":244},{"title":38,"description":394,"meta":395,"path":246},"Built-in database support with SQL template literals.",{"automd":381,"category":382,"icon":248},{"title":250,"description":397,"meta":398,"path":251},"Integrate Elysia with Nitro using the server entry.",{"automd":381,"category":399,"icon":253},"backend frameworks",{"title":255,"description":401,"meta":402,"path":256},"Integrate Express with Nitro using the server entry.",{"automd":381,"category":399,"icon":258},{"title":260,"description":404,"meta":405,"path":261},"Integrate Fastify with Nitro using the server entry.",{"automd":381,"category":399,"icon":263},{"title":265,"description":407,"meta":408,"path":266},"Minimal Nitro server using the web standard fetch handler.",{"automd":381,"category":382,"icon":268},{"title":270,"description":410,"meta":411,"path":271},"Integrate Hono with Nitro using the server entry.",{"automd":381,"category":399,"icon":273},{"title":275,"description":413,"meta":414,"path":276},"Custom import aliases for cleaner module paths.",{"automd":381,"category":386,"icon":278},{"title":280,"description":416,"meta":417,"path":281},"Request middleware for authentication, logging, and request modification.",{"automd":381,"category":382,"icon":46},{"title":284,"description":419,"meta":420,"path":285},"Server-side JSX rendering in Nitro with mono-jsx.",{"automd":381,"category":421,"icon":287},"server side rendering",{"title":289,"description":423,"meta":424,"path":290},"Server-side JSX rendering in Nitro with nano-jsx.",{"automd":381,"category":421,"icon":287},{"title":48,"description":426,"meta":427,"path":293},"Extend Nitro with custom plugins for hooks and lifecycle events.",{"automd":381,"category":382,"icon":295},{"title":297,"description":429,"meta":430,"path":298},"Build a custom HTML renderer in Nitro with server-side data fetching.",{"automd":381,"category":421,"icon":300},{"title":302,"description":432,"meta":433,"path":303},"Environment-aware configuration with runtime access.",{"automd":381,"category":386,"icon":305},{"title":307,"description":435,"meta":436,"path":308},"Internal server-to-server requests without network overhead.",{"automd":381,"category":382,"icon":310},{"title":312,"description":438,"meta":439,"path":313},"Server-side syntax highlighting in Nitro with Shiki.",{"automd":381,"category":440,"icon":315},"integrations",{"title":317,"description":442,"meta":443,"path":318},"Define routes programmatically using Nitro's virtual module system.",{"automd":381,"category":382,"icon":320},{"title":322,"description":445,"meta":446,"path":323},"Use Nitro as a Vite plugin for programmatic configuration.",{"automd":381,"category":447,"icon":325},"vite",{"title":327,"description":449,"meta":450,"path":328},"React Server Components with Vite and Nitro.",{"automd":381,"category":447,"icon":330},{"title":332,"description":452,"meta":453,"path":333},"Server-side rendering with vanilla HTML, Vite, and Nitro.",{"automd":381,"category":421,"icon":335},{"title":337,"description":455,"meta":456,"path":338},"Server-side rendering with Preact in Nitro using Vite.",{"automd":381,"category":421,"icon":340},{"title":342,"description":458,"meta":459,"path":343},"Server-side rendering with React in Nitro using Vite.",{"automd":381,"category":421,"icon":330},{"title":346,"description":461,"meta":462,"path":347},"Server-side rendering with SolidJS in Nitro using Vite.",{"automd":381,"category":421,"icon":349},{"title":351,"description":464,"meta":465,"path":352},"Client-side routing with TanStack Router in Nitro using Vite.",{"automd":381,"category":421,"icon":354},{"title":356,"description":467,"meta":468,"path":357},"Full-stack React with TanStack Start in Nitro using Vite.",{"automd":381,"category":421,"icon":354},{"title":360,"description":470,"meta":471,"path":361},"Server-side rendering with Vue Router in Nitro using Vite.",{"automd":381,"category":421,"icon":363},{"title":365,"description":473,"meta":474,"path":366},"End-to-end typesafe APIs with tRPC in Nitro using Vite.",{"automd":381,"category":447,"icon":368},{"title":370,"description":476,"meta":477,"path":371},"Real-time bidirectional communication with WebSocket support.",{"automd":381,"category":382,"icon":373},{"id":479,"title":48,"body":480,"description":426,"extension":1117,"meta":1118,"navigation":1119,"path":293,"seo":1120,"stem":294,"__hash__":1121},"content/4.examples/plugins.md",{"type":481,"value":482,"toc":1112,"icon":295},"minimark",[483,910,922,927,1033,1044,1048,1084,1091,1095,1108],[484,485,488,561,654,699,723,777],"code-tree",{":expand-all":486,"default-value":487},"true","server/plugins/test.ts",[489,490,495],"pre",{"className":491,"code":492,"filename":493,"language":494,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  serverDir: true,\n});\n","nitro.config.ts","ts",[496,497,498,521,527,543,555],"code",{"__ignoreMap":5},[499,500,503,507,511,514,518],"span",{"class":501,"line":502},"line",1,[499,504,506],{"class":505},"so5gQ","import",[499,508,510],{"class":509},"slsVL"," { defineConfig } ",[499,512,513],{"class":505},"from",[499,515,517],{"class":516},"sfrk1"," \"nitro\"",[499,519,520],{"class":509},";\n",[499,522,524],{"class":501,"line":523},2,[499,525,526],{"emptyLinePlaceholder":381},"\n",[499,528,530,533,536,540],{"class":501,"line":529},3,[499,531,532],{"class":505},"export",[499,534,535],{"class":505}," default",[499,537,539],{"class":538},"shcOC"," defineConfig",[499,541,542],{"class":509},"({\n",[499,544,546,549,552],{"class":501,"line":545},4,[499,547,548],{"class":509},"  serverDir: ",[499,550,486],{"class":551},"suiK_",[499,553,554],{"class":509},",\n",[499,556,558],{"class":501,"line":557},5,[499,559,560],{"class":509},"});\n",[489,562,567],{"className":563,"code":564,"filename":565,"language":566,"meta":5,"style":5},"language-json shiki shiki-themes github-light github-dark github-dark","{\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"nitro dev\",\n    \"build\": \"nitro build\"\n  },\n  \"devDependencies\": {\n    \"nitro\": \"latest\"\n  }\n}\n","package.json","json",[496,568,569,574,587,595,607,617,623,631,642,648],{"__ignoreMap":5},[499,570,571],{"class":501,"line":502},[499,572,573],{"class":509},"{\n",[499,575,576,579,582,585],{"class":501,"line":523},[499,577,578],{"class":551},"  \"type\"",[499,580,581],{"class":509},": ",[499,583,584],{"class":516},"\"module\"",[499,586,554],{"class":509},[499,588,589,592],{"class":501,"line":529},[499,590,591],{"class":551},"  \"scripts\"",[499,593,594],{"class":509},": {\n",[499,596,597,600,602,605],{"class":501,"line":545},[499,598,599],{"class":551},"    \"dev\"",[499,601,581],{"class":509},[499,603,604],{"class":516},"\"nitro dev\"",[499,606,554],{"class":509},[499,608,609,612,614],{"class":501,"line":557},[499,610,611],{"class":551},"    \"build\"",[499,613,581],{"class":509},[499,615,616],{"class":516},"\"nitro build\"\n",[499,618,620],{"class":501,"line":619},6,[499,621,622],{"class":509},"  },\n",[499,624,626,629],{"class":501,"line":625},7,[499,627,628],{"class":551},"  \"devDependencies\"",[499,630,594],{"class":509},[499,632,634,637,639],{"class":501,"line":633},8,[499,635,636],{"class":551},"    \"nitro\"",[499,638,581],{"class":509},[499,640,641],{"class":516},"\"latest\"\n",[499,643,645],{"class":501,"line":644},9,[499,646,647],{"class":509},"  }\n",[499,649,651],{"class":501,"line":650},10,[499,652,653],{"class":509},"}\n",[489,655,658],{"className":491,"code":656,"filename":657,"language":494,"meta":5,"style":5},"import { eventHandler } from \"h3\";\n\nexport default eventHandler(() => \"\u003Ch1>Hello Nitro!\u003C/h1>\");\n","server.ts",[496,659,660,674,678],{"__ignoreMap":5},[499,661,662,664,667,669,672],{"class":501,"line":502},[499,663,506],{"class":505},[499,665,666],{"class":509}," { eventHandler } ",[499,668,513],{"class":505},[499,670,671],{"class":516}," \"h3\"",[499,673,520],{"class":509},[499,675,676],{"class":501,"line":523},[499,677,526],{"emptyLinePlaceholder":381},[499,679,680,682,684,687,690,693,696],{"class":501,"line":529},[499,681,532],{"class":505},[499,683,535],{"class":505},[499,685,686],{"class":538}," eventHandler",[499,688,689],{"class":509},"(() ",[499,691,692],{"class":505},"=>",[499,694,695],{"class":516}," \"\u003Ch1>Hello Nitro!\u003C/h1>\"",[499,697,698],{"class":509},");\n",[489,700,703],{"className":563,"code":701,"filename":702,"language":566,"meta":5,"style":5},"{\n  \"extends\": \"nitro/tsconfig\"\n}\n","tsconfig.json",[496,704,705,709,719],{"__ignoreMap":5},[499,706,707],{"class":501,"line":502},[499,708,573],{"class":509},[499,710,711,714,716],{"class":501,"line":523},[499,712,713],{"class":551},"  \"extends\"",[499,715,581],{"class":509},[499,717,718],{"class":516},"\"nitro/tsconfig\"\n",[499,720,721],{"class":501,"line":529},[499,722,653],{"class":509},[489,724,727],{"className":491,"code":725,"filename":726,"language":494,"meta":5,"style":5},"import { defineConfig } from \"vite\";\nimport { nitro } from \"nitro/vite\";\n\nexport default defineConfig({ plugins: [nitro()] });\n","vite.config.ts",[496,728,729,742,756,760],{"__ignoreMap":5},[499,730,731,733,735,737,740],{"class":501,"line":502},[499,732,506],{"class":505},[499,734,510],{"class":509},[499,736,513],{"class":505},[499,738,739],{"class":516}," \"vite\"",[499,741,520],{"class":509},[499,743,744,746,749,751,754],{"class":501,"line":523},[499,745,506],{"class":505},[499,747,748],{"class":509}," { nitro } ",[499,750,513],{"class":505},[499,752,753],{"class":516}," \"nitro/vite\"",[499,755,520],{"class":509},[499,757,758],{"class":501,"line":529},[499,759,526],{"emptyLinePlaceholder":381},[499,761,762,764,766,768,771,774],{"class":501,"line":545},[499,763,532],{"class":505},[499,765,535],{"class":505},[499,767,539],{"class":538},[499,769,770],{"class":509},"({ plugins: [",[499,772,773],{"class":538},"nitro",[499,775,776],{"class":509},"()] });\n",[489,778,780],{"className":491,"code":779,"filename":487,"language":494,"meta":5,"style":5},"import { definePlugin } from \"nitro\";\nimport { useNitroHooks } from \"nitro/app\";\n\nexport default definePlugin((nitroApp) => {\n  const hooks = useNitroHooks();\n  hooks.hook(\"response\", (event) => {\n    event.headers.set(\"content-type\", \"html; charset=utf-8\");\n  });\n});\n",[496,781,782,795,809,813,837,854,880,901,906],{"__ignoreMap":5},[499,783,784,786,789,791,793],{"class":501,"line":502},[499,785,506],{"class":505},[499,787,788],{"class":509}," { definePlugin } ",[499,790,513],{"class":505},[499,792,517],{"class":516},[499,794,520],{"class":509},[499,796,797,799,802,804,807],{"class":501,"line":523},[499,798,506],{"class":505},[499,800,801],{"class":509}," { useNitroHooks } ",[499,803,513],{"class":505},[499,805,806],{"class":516}," \"nitro/app\"",[499,808,520],{"class":509},[499,810,811],{"class":501,"line":529},[499,812,526],{"emptyLinePlaceholder":381},[499,814,815,817,819,822,825,829,832,834],{"class":501,"line":545},[499,816,532],{"class":505},[499,818,535],{"class":505},[499,820,821],{"class":538}," definePlugin",[499,823,824],{"class":509},"((",[499,826,828],{"class":827},"sQHwn","nitroApp",[499,830,831],{"class":509},") ",[499,833,692],{"class":505},[499,835,836],{"class":509}," {\n",[499,838,839,842,845,848,851],{"class":501,"line":557},[499,840,841],{"class":505},"  const",[499,843,844],{"class":551}," hooks",[499,846,847],{"class":505}," =",[499,849,850],{"class":538}," useNitroHooks",[499,852,853],{"class":509},"();\n",[499,855,856,859,862,865,868,871,874,876,878],{"class":501,"line":619},[499,857,858],{"class":509},"  hooks.",[499,860,861],{"class":538},"hook",[499,863,864],{"class":509},"(",[499,866,867],{"class":516},"\"response\"",[499,869,870],{"class":509},", (",[499,872,873],{"class":827},"event",[499,875,831],{"class":509},[499,877,692],{"class":505},[499,879,836],{"class":509},[499,881,882,885,888,890,893,896,899],{"class":501,"line":625},[499,883,884],{"class":509},"    event.headers.",[499,886,887],{"class":538},"set",[499,889,864],{"class":509},[499,891,892],{"class":516},"\"content-type\"",[499,894,895],{"class":509},", ",[499,897,898],{"class":516},"\"html; charset=utf-8\"",[499,900,698],{"class":509},[499,902,903],{"class":501,"line":633},[499,904,905],{"class":509},"  });\n",[499,907,908],{"class":501,"line":644},[499,909,560],{"class":509},[911,912,913,914,917,918,921],"p",{},"Plugins let you hook into Nitro's runtime lifecycle. This example shows a plugin that modifies the ",[496,915,916],{},"Content-Type"," header on every response. Create files in ",[496,919,920],{},"server/plugins/"," and they're automatically loaded at startup.",[923,924,926],"h2",{"id":925},"defining-a-plugin","Defining a Plugin",[489,928,929],{"className":491,"code":779,"filename":487,"language":494,"meta":5,"style":5},[496,930,931,943,955,959,977,989,1009,1025,1029],{"__ignoreMap":5},[499,932,933,935,937,939,941],{"class":501,"line":502},[499,934,506],{"class":505},[499,936,788],{"class":509},[499,938,513],{"class":505},[499,940,517],{"class":516},[499,942,520],{"class":509},[499,944,945,947,949,951,953],{"class":501,"line":523},[499,946,506],{"class":505},[499,948,801],{"class":509},[499,950,513],{"class":505},[499,952,806],{"class":516},[499,954,520],{"class":509},[499,956,957],{"class":501,"line":529},[499,958,526],{"emptyLinePlaceholder":381},[499,960,961,963,965,967,969,971,973,975],{"class":501,"line":545},[499,962,532],{"class":505},[499,964,535],{"class":505},[499,966,821],{"class":538},[499,968,824],{"class":509},[499,970,828],{"class":827},[499,972,831],{"class":509},[499,974,692],{"class":505},[499,976,836],{"class":509},[499,978,979,981,983,985,987],{"class":501,"line":557},[499,980,841],{"class":505},[499,982,844],{"class":551},[499,984,847],{"class":505},[499,986,850],{"class":538},[499,988,853],{"class":509},[499,990,991,993,995,997,999,1001,1003,1005,1007],{"class":501,"line":619},[499,992,858],{"class":509},[499,994,861],{"class":538},[499,996,864],{"class":509},[499,998,867],{"class":516},[499,1000,870],{"class":509},[499,1002,873],{"class":827},[499,1004,831],{"class":509},[499,1006,692],{"class":505},[499,1008,836],{"class":509},[499,1010,1011,1013,1015,1017,1019,1021,1023],{"class":501,"line":625},[499,1012,884],{"class":509},[499,1014,887],{"class":538},[499,1016,864],{"class":509},[499,1018,892],{"class":516},[499,1020,895],{"class":509},[499,1022,898],{"class":516},[499,1024,698],{"class":509},[499,1026,1027],{"class":501,"line":633},[499,1028,905],{"class":509},[499,1030,1031],{"class":501,"line":644},[499,1032,560],{"class":509},[911,1034,1035,1036,1039,1040,1043],{},"The plugin uses ",[496,1037,1038],{},"useNitroHooks()"," to access the hooks system, then registers a ",[496,1041,1042],{},"response"," hook that runs after every request. Here it sets the content type to HTML, but you could log requests, add security headers, or modify responses in any way.",[923,1045,1047],{"id":1046},"main-handler","Main Handler",[489,1049,1050],{"className":491,"code":656,"filename":657,"language":494,"meta":5,"style":5},[496,1051,1052,1064,1068],{"__ignoreMap":5},[499,1053,1054,1056,1058,1060,1062],{"class":501,"line":502},[499,1055,506],{"class":505},[499,1057,666],{"class":509},[499,1059,513],{"class":505},[499,1061,671],{"class":516},[499,1063,520],{"class":509},[499,1065,1066],{"class":501,"line":523},[499,1067,526],{"emptyLinePlaceholder":381},[499,1069,1070,1072,1074,1076,1078,1080,1082],{"class":501,"line":529},[499,1071,532],{"class":505},[499,1073,535],{"class":505},[499,1075,686],{"class":538},[499,1077,689],{"class":509},[499,1079,692],{"class":505},[499,1081,695],{"class":516},[499,1083,698],{"class":509},[911,1085,1086,1087,1090],{},"The handler returns HTML without setting a content type. The plugin automatically adds the correct ",[496,1088,1089],{},"Content-Type: html; charset=utf-8"," header to the response.",[923,1092,1094],{"id":1093},"learn-more","Learn More",[1096,1097,1098,1104],"ul",{},[1099,1100,1101],"li",{},[1102,1103,48],"a",{"href":49},[1099,1105,1106],{},[1102,1107,43],{"href":44},[1109,1110,1111],"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}",{"title":5,"searchDepth":523,"depth":523,"links":1113},[1114,1115,1116],{"id":925,"depth":523,"text":926},{"id":1046,"depth":523,"text":1047},{"id":1093,"depth":523,"text":1094},"md",{"automd":381,"category":382,"icon":295},{"icon":295},{"title":48,"description":426},"5Uyqr4u_TAVC7FhXsYXnVDGncZvA2AXcoVAFNulJ-NA",[1123,1124],{"title":289,"path":290,"stem":291,"description":423,"icon":287,"children":-1},{"title":297,"path":298,"stem":299,"description":429,"icon":300,"children":-1},1773242040044]