Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
site: give example of passing a session option (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Bowdoin authored Feb 26, 2020
1 parent 7d3a85c commit d062e75
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion site/content/docs/04-preloading.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ So if the example above was `src/routes/blog/[slug].svelte` and the URL was `/bl
* `page.query.foo === 'bar'`
* `page.query.baz === true`

`session` is generated on the server by the `session` option passed to `sapper.middleware` (TODO this needs further documentation. Perhaps a server API section?)
`session` is generated on the server by the `session` option passed to `sapper.middleware`. For example:

```js
sapper.middleware({
session: (req, res) => ({
user: req.user
})
})
```


### Return value
Expand Down

0 comments on commit d062e75

Please sign in to comment.