-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganizing new docs menu/files (#1662)
* reorganizing pages * moving files around * minor edits, putting links back in
- Loading branch information
Melissa McEwen
authored
Nov 19, 2020
1 parent
4f344ce
commit 3fc6cf0
Showing
12 changed files
with
145 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
layout: layouts/main.njk | ||
title: SSL Certificates | ||
--- | ||
|
||
## Generating SSL Certificates | ||
|
||
You can automatically generate credentials for your project via either: | ||
|
||
- [devcert (no install required)](https://github.com/davewasmer/devcert-cli): `npx devcert-cli generate localhost` | ||
- [mkcert (install required)](https://github.com/FiloSottile/mkcert): `mkcert -install && mkcert -key-file snowpack.key -cert-file snowpack.crt localhost` | ||
|
||
In most situations you should add personally generated certificate files (`snowpack.key` and `snowpack.crt`) to your `.gitignore` file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
layout: layouts/main.njk | ||
title: SSR | ||
--- | ||
|
||
SSR for Snowpack is supported but fairly new and experimental. This documentation will be updated as we finalize support over the next few minor versions. | ||
|
||
```js | ||
// New in Snowpack v2.15.0 - JS API Example | ||
import {startDevServer} from 'snowpack'; | ||
const server = await startDevServer({ ... }); | ||
``` | ||
|
||
These frameworks have known experiments / examples of using SSR + Snowpack: | ||
|
||
- React (Example): https://github.com/matthoffner/snowpack-react-ssr | ||
- Svelte/Sapper (Experiment): https://github.com/Rich-Harris/snowpack-svelte-ssr | ||
- [Join our Discord](https://discord.gg/rS8SnRk) if you're interested in getting involved! | ||
|
||
To connect your own server to `snowpack dev` for SSR, there are a few things that you'll need to set up. Make sure that you include any Snowpack-built resources via script tags in your server's HTML response: | ||
|
||
```html | ||
<!-- Example: Create Snowpack App builds your src/ directory to the /_dist_/* directory --> | ||
<script type="module" src="http://localhost:8080/_dist_/index.js"></script> | ||
``` | ||
|
||
And make sure that your HTML response also includes code to configure HMR to talk to Snowpack's dev server: | ||
|
||
```html | ||
<!-- Configure Snowpack's HMR connection yourself, somewhere on your page HTML --> | ||
<script> | ||
window.HMR_WEBSOCKET_URL = 'ws://localhost:8080'; | ||
</script> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.