Unverified Commit 55fdfe42 authored by Steven Tey's avatar Steven Tey Committed by GitHub

Update 02-edge-and-nodejs-runtimes.mdx (#52888)

Added clarification that runtime edge can be defined on Layout level too.
Co-authored-by: 's avatarSteven <229881+styfle@users.noreply.github.com>
Co-authored-by: 's avatarBalázs Orbán <18369201+balazsorban44@users.noreply.github.com>
parent 91c31c69
...@@ -68,6 +68,16 @@ export const runtime = 'edge' // 'nodejs' (default) | 'edge' ...@@ -68,6 +68,16 @@ export const runtime = 'edge' // 'nodejs' (default) | 'edge'
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. 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> </AppOnly>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment