Skip to content

Commit

Permalink
docs(getting-started): add schema for server
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Oct 20, 2023
1 parent 3eef1b3 commit 6d0f454
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/1.getting-started/8.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ Nuxt's server framework allows you to build **full-stack applications**. For exa

## Powered by Nitro

Nuxt's server is [Nitro](https://github.com/unjs/nitro). Nitro was originally created for Nuxt but is now part of [UnJS](https://unjs.io) and used for other frameworks - and can even be used on its own.
![Server engine](/assets/docs/getting-started/server.svg)

Nuxt's server is [Nitro](https://github.com/unjs/nitro). It was originally created for Nuxt but is now part of [UnJS](https://unjs.io) and open for other frameworks - and can even be used on its own.

Using Nitro gives Nuxt superpowers:

- Full control of the server-side part of your app
- Universal deployment on any provider (many zero-config)
- Hybrid rendering

## Full control of the server-side part of your app
Nitro is internally using [h3](https://github.com/unjs/h3), a minimal H(TTP) framework built for high performance and portability.

## Server Endpoints & Middleware

With Nitro, you can easily manage the server part of your Nuxt app, from API endpoints to middleware.
You can easily manage the server-only part of your Nuxt app, from API endpoints to middleware.

Both endpoints and middleware can be defined like this:

Expand All @@ -32,7 +36,7 @@ export default defineEventHandler(async (event) => {

And you can directly return `text`, `json`, `html` or even a `stream`.

Out-of-the-box, Nitro supports **hot module replacement** and **auto-import** like the other parts of your Nuxt application.
Out-of-the-box, it supports **hot module replacement** and **auto-import** like the other parts of your Nuxt application.

:read-more{to="/docs/guide/directory-structure/server"}

Expand All @@ -42,7 +46,7 @@ Nitro offers the ability to deploy your Nuxt app anywhere, from a bare metal ser

:read-more{to="/blog/nuxt-on-the-edge"}

Today, Nitro offers more than 15 presets to build your Nuxt app for different cloud providers and servers, including:
There are more than 15 presets to build your Nuxt app for different cloud providers and servers, including:

- [Cloudflare Workers](https://workers.cloudflare.com)
- [Netlify Functions](https://www.netlify.com/products/functions)
Expand All @@ -60,8 +64,6 @@ Or for other runtimes:

## Hybrid Rendering

Do you need both static and dynamic pages in your Nuxt app? Nitro has your back!

Nitro has a powerful feature called `routeRules` which allows you to define a set of rules to customize how each route of your Nuxt app is rendered (and more).

```ts [nuxt.config.ts]
Expand All @@ -84,7 +86,7 @@ export default defineNuxtConfig({
Learn about all available route rules are available to customize the rendering mode of your routes.
::
In addition, there are some route rules (for example, `ssr` and `experimentalNoScripts`) that are not Nuxt specific to change the behavior when rendering your pages to HTML.
In addition, there are some route rules (for example, `ssr` and `experimentalNoScripts`) that are Nuxt specific to change the behavior when rendering your pages to HTML.
Some route rules (`redirect` and `prerender`) also affect client-side behavior.
Expand Down

0 comments on commit 6d0f454

Please sign in to comment.