Update 02-edge-and-nodejs-runtimes.mdx (#52888)
Added clarification that runtime edge can be defined on Layout level too. Co-authored-by: Steven <229881+styfle@users.noreply.github.com> Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
This commit is contained in:
parent
91c31c69b0
commit
55fdfe4280
1 changed files with 10 additions and 0 deletions
|
@ -68,6 +68,16 @@ export const runtime = 'edge' // 'nodejs' (default) | 'edge'
|
|||
export const runtime = 'edge' // 'nodejs' (default) | 'edge'
|
||||
```
|
||||
|
||||
You can also define `runtime` on a layout level, which will make all routes under the layout run on the edge runtime:
|
||||
|
||||
```tsx filename="app/layout.tsx" switcher
|
||||
export const runtime = 'edge' // 'nodejs' (default) | 'edge'
|
||||
```
|
||||
|
||||
```jsx filename="app/layout.js" switcher
|
||||
export const runtime = 'edge' // 'nodejs' (default) | 'edge'
|
||||
```
|
||||
|
||||
If the segment runtime is _not_ set, the default `nodejs` runtime will be used. You do not need to use the `runtime` option if you do not plan to change from the Node.js runtime.
|
||||
|
||||
</AppOnly>
|
||||
|
|
Loading…
Reference in a new issue