Skip to content

Commit

Permalink
docs: explain that +layout files do not affect +server.js (#13152)
Browse files Browse the repository at this point in the history
closes #12401
  • Loading branch information
eltigerchino authored Dec 12, 2024
1 parent f121323 commit 47890e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion documentation/docs/20-core-concepts/10-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Pages can receive data from `load` functions via the `data` prop.
> [!LEGACY]
> In Svelte 4, you'd use `export let data` instead
> [!NOTE] Note that SvelteKit uses `<a>` elements to navigate between routes, rather than a framework-specific `<Link>` component.
> [!NOTE] SvelteKit uses `<a>` elements to navigate between routes, rather than a framework-specific `<Link>` component.
### +page.js

Expand Down Expand Up @@ -302,6 +302,8 @@ If an error is thrown (either `error(...)` or an unexpected error), the response
> [!NOTE] When creating an `OPTIONS` handler, note that Vite will inject `Access-Control-Allow-Origin` and `Access-Control-Allow-Methods` headers — these will not be present in production unless you add them.
> [!NOTE] `+layout` files have no effect on `+server.js` files. If you want to run some logic before each request, add it to the server [`handle`](hooks#Server-hooks-handle) hook.
### Receiving data
By exporting `POST`/`PUT`/`PATCH`/`DELETE`/`OPTIONS`/`HEAD` handlers, `+server.js` files can be used to create a complete API:
Expand Down

0 comments on commit 47890e0

Please sign in to comment.