Skip to content

Change node to Node.js to avoid misunderstood. #864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/v2/guide/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If you're using Webpack, you can easily add prerendering with the [prerender-spa

## Hello World

If you've gotten this far, you're ready to see SSR in action. It sounds complex, but a simple node script demoing the feature requires only 3 steps:
If you've gotten this far, you're ready to see SSR in action. It sounds complex, but a simple Node.js script demoing the feature requires only 3 steps:

``` js
// Step 1: Create a Vue instance
Expand Down Expand Up @@ -86,10 +86,10 @@ new Vue({
})
```

To adapt this for SSR, there are a few modifications we'll have to make, so that it will work both in the browser and within node:
To adapt this for SSR, there are a few modifications we'll have to make, so that it will work both in the browser and within Node.js:

- When in the browser, add an instance of our app to the global context (i.e. `window`), so that we can mount it.
- When in node, export a factory function so that we can create a fresh instance of the app for every request.
- When in Node.js, export a factory function so that we can create a fresh instance of the app for every request.

Accomplishing this requires a little boilerplate:

Expand Down