Skip to content

Commit

Permalink
[docs] Document adapter changes required by sveltejs#2394
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlinator committed Sep 12, 2021
1 parent c8de01c commit 8d0d367
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions documentation/docs/80-adapter-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Within the `adapt` method, there are a number of things that an adapter should d
- Calls `init`
- Converts from the platform's request to a [SvelteKit request](#hooks-handle), calls `render`, and converts from a [SvelteKit response](#hooks-handle) to the platform's
- Globally shims `fetch` to work on the target platform. SvelteKit provides a `@sveltejs/kit/install-fetch` helper for platforms that can use `node-fetch`
- Globally shims a function `generateRandomString(bytes: number)`, which returns a base64-encoded cryptographically-secure random string (suitable, for instance, for use in a CSP nonce), with a length given by the `bytes` parameter. Usually this is done with either Node's `crypto` module or the WebCrypto API.
- Bundle the output to avoid needing to install dependencies on the target platform, if desired
- Call `utils.prerender`
- Put the user's static files and the generated JS/CSS in the correct location for the target platform
Expand Down

0 comments on commit 8d0d367

Please sign in to comment.