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