From b1ba875abe96db78dd16debffbbdbc55d444e61f Mon Sep 17 00:00:00 2001 From: Restent Ou Date: Wed, 24 Dec 2025 01:03:44 +0800 Subject: [PATCH 1/2] docs(introduction): add headings --- docs/1.docs/1.index.md | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/docs/1.docs/1.index.md b/docs/1.docs/1.index.md index db87b8f0c4..3dbdb8fb2c 100644 --- a/docs/1.docs/1.index.md +++ b/docs/1.docs/1.index.md @@ -6,22 +6,48 @@ icon: i-lucide-compass > Nitro is a full-stack framework, compatible with any runtime. It extends your Vite application with a production-ready server. -Vite’s main purpose is to build frontend applications. It provides a fast dev server to transform and serve resources with HMR, but it doesn’t include a production server. +## Extends Vite application -When creating an SPA, you often need to add API routes—whether to bypass CORS, call services with an API token, or implement your own backend logic. Nitro lets you create server and API routes inside the `routes/` directory of your project. You can even go further and take control of the entire server entry by creating a `server.ts` file. With its high-level and runtime-agnostic approach, Nitro allows you to use any HTTP library, such as [Elysia](https://elysiajs.com/), [h3](https://h3.dev) or [Hono](https://hono.dev). +Vite’s main purpose is to build frontend applications, so it only provides a fast dev server to transform and serve resources with HMR. You can easily have a production server by extending your Vite application with Nitro. -But that’s not all: running `vite build` also builds both your backend and frontend code into an optimized `.output/` folder. This output is compatible not only with Node.js, Bun, and Deno, but also with many hosting platforms without any configuration. This means you can deploy your full-stack Vite application to Cloudflare Workers, Netlify, Vercel, and more, without changing a single line of code, while taking advantage of platform features like ESR, ISR, and SWR. +### Create API routes + +When creating an SPA, you often need to add API routes—whether to bypass CORS, call services with an API token, or implement your own backend logic. Nitro lets you create server and API routes inside the `routes/` directory of your project. + +### Platform compatibility + +Running `vite build` builds both your backend and frontend code into an optimized `.output/` folder. This output is compatible not only with Node.js, Bun, and Deno, but also with many hosting platforms without any configuration. This means you can deploy your full-stack Vite application to Cloudflare Workers, Netlify, Vercel, and more, without changing a single line of code, while taking advantage of platform features like ESR, ISR, and SWR. + +## Use the HTTP library you like + +You can go further and take control of the entire server entry by creating a `server.ts` file. With its high-level and runtime-agnostic approach, Nitro allows you to use any HTTP library, such as [Elysia](https://elysiajs.com/), [h3](https://h3.dev) or [Hono](https://hono.dev). + +## Optimal Performance The Nitro server is highly performant. By combining code-splitting with compiled routes, it removes the need for a runtime router, leaving only minimal compiled logic. This makes it ideal for serverless hosting, since boot-up time is nearly 0ms regardless of project size and only the code required to handle the incoming request is loaded and executed. -Having a server also unlocks server-side rendering. You can render HTML with your favorite templating engine, or use component libraries such as React, Vue, or Svelte directly on the server. You can even go full universal rendering with client-side hydration. Nitro provides the foundation and a progressive approach to reach your goals. +## Server-Side Rendering + +You can render HTML with your favorite templating engine, or use component libraries such as React, Vue, or Svelte directly on the server. You can even go full universal rendering with client-side hydration. Nitro provides the foundation and a progressive approach to reach your goals. + +## Built-in functions + +### KV Storage Server data storage is often needed, and Nitro includes a runtime-agnostic key-value storage layer out of the box. It uses in-memory storage by default, but you can connect more than 20 different drivers (FS, Redis, S3, etc.), attach them to different namespaces, and swap them without changing your code. +### Cache + Caching is a key part of any web server, which is why Nitro supports caching for both server routes and server functions, backed directly by the server storage (via the `cache` namespace). +### SQL Database + When key-value storage isn’t enough, Nitro also includes a built-in SQL database. It defaults to SQLite, but you can connect to and query more than 10 databases (Postgres, MySQL, PGLite, etc.) using the same API. -Last but not least, Nitro can be used as the foundation for building your own meta-framework. Popular frameworks such as Nuxt, SolidStart and TanStack Start fully or partially leverage Nitro. +## Build your meta-framework with Nitro + +Nitro can be used as the foundation for building a meta-framework. Popular frameworks such as Nuxt, SolidStart and TanStack Start fully or partially leverage Nitro. + +## Try it now Ready to give it a try? Jump into the [quick start](/docs/quick-start). From c1612b276c7420f42e73aa2e8f5fe8486a7b837e Mon Sep 17 00:00:00 2001 From: Restent Ou Date: Sat, 31 Jan 2026 00:19:03 +0800 Subject: [PATCH 2/2] adjust the layout --- docs/1.docs/1.index.md | 48 +++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/docs/1.docs/1.index.md b/docs/1.docs/1.index.md index 3dbdb8fb2c..8647e4208d 100644 --- a/docs/1.docs/1.index.md +++ b/docs/1.docs/1.index.md @@ -4,37 +4,53 @@ icon: i-lucide-compass # Introduction -> Nitro is a full-stack framework, compatible with any runtime. It extends your Vite application with a production-ready server. +> Welcome to Nitro: Progressive, Compatible, and Production-Ready. -## Extends Vite application +Nitro is a full-stack framework that can run as a standalone backend server or extend your Vite application with a production-ready server. -Vite’s main purpose is to build frontend applications, so it only provides a fast dev server to transform and serve resources with HMR. You can easily have a production server by extending your Vite application with Nitro. +## Extend your Vite application with... -### Create API routes +### Production-ready server -When creating an SPA, you often need to add API routes—whether to bypass CORS, call services with an API token, or implement your own backend logic. Nitro lets you create server and API routes inside the `routes/` directory of your project. +As a bundler, Vite's main purpose is to build frontend applications. So it only provides a fast dev server to transform and serve resources with HMR. -### Platform compatibility +By extending your Vite application with Nitro, you can easily have a production-ready server. Running `vite build` builds both your backend and frontend code into an optimized `.output/` folder. -Running `vite build` builds both your backend and frontend code into an optimized `.output/` folder. This output is compatible not only with Node.js, Bun, and Deno, but also with many hosting platforms without any configuration. This means you can deploy your full-stack Vite application to Cloudflare Workers, Netlify, Vercel, and more, without changing a single line of code, while taking advantage of platform features like ESR, ISR, and SWR. +### API Routes -## Use the HTTP library you like +When creating an SPA, you often need to add API routes—whether to bypass CORS, call services with an API token, or implement your own backend logic. -You can go further and take control of the entire server entry by creating a `server.ts` file. With its high-level and runtime-agnostic approach, Nitro allows you to use any HTTP library, such as [Elysia](https://elysiajs.com/), [h3](https://h3.dev) or [Hono](https://hono.dev). +Nitro lets you create server and API routes inside the `routes/` directory of your project. -## Optimal Performance +### Server-Side Rendering + +Having a server also unlocks server-side rendering. You can render HTML with your favorite templating engine, or use component libraries such as React, Vue, or Svelte directly on the server. You can even go full universal rendering with client-side hydration. + +Nitro provides the foundation and a progressive approach to reach your goals. -The Nitro server is highly performant. By combining code-splitting with compiled routes, it removes the need for a runtime router, leaving only minimal compiled logic. This makes it ideal for serverless hosting, since boot-up time is nearly 0ms regardless of project size and only the code required to handle the incoming request is loaded and executed. +## Deploy to anywhere -## Server-Side Rendering +Nitro has excellent cross-platform compatibility. Its output is compatible not only with Node.js, Bun, and Deno, but also with many hosting platforms without any configuration. -You can render HTML with your favorite templating engine, or use component libraries such as React, Vue, or Svelte directly on the server. You can even go full universal rendering with client-side hydration. Nitro provides the foundation and a progressive approach to reach your goals. +This means you can deploy your application to Cloudflare Workers, Netlify, Vercel, and more, without changing a single line of code, while taking advantage of platform features like ESR, ISR, and SWR. + +## Integrate with other frameworks + +You can go further and take control of the entire server entry by creating a `server.ts` file. With its high-level and runtime-agnostic approach, Nitro allows you to use any HTTP library, such as [Elysia](https://elysiajs.com/), [Express](https://expressjs.com/), [h3](https://h3.dev/) or [Hono](https://hono.dev/). + +## Optimal Performance + +By combining code-splitting with compiled routes, Nitro removes the need for a runtime router, leaving only minimal compiled logic. + +This makes it ideal for serverless hosting, since boot-up time is nearly 0ms regardless of project size and only the code required to handle the incoming request is loaded and executed. ## Built-in functions ### KV Storage -Server data storage is often needed, and Nitro includes a runtime-agnostic key-value storage layer out of the box. It uses in-memory storage by default, but you can connect more than 20 different drivers (FS, Redis, S3, etc.), attach them to different namespaces, and swap them without changing your code. +Server data storage is often needed, and Nitro includes a runtime-agnostic key-value storage layer out of the box. + +It uses in-memory storage by default. You can connect more than 20 different drivers (FS, Redis, S3, etc.), attach them to different namespaces, and swap them without changing your code. ### Cache @@ -42,7 +58,9 @@ Caching is a key part of any web server, which is why Nitro supports caching for ### SQL Database -When key-value storage isn’t enough, Nitro also includes a built-in SQL database. It defaults to SQLite, but you can connect to and query more than 10 databases (Postgres, MySQL, PGLite, etc.) using the same API. +When key-value storage isn' t enough, Nitro also includes a built-in SQL database. + +It defaults to SQLite and allows you to connect to and query more than 10 databases (Postgres, MySQL, PGLite, etc.) using the same API. ## Build your meta-framework with Nitro