Skip to content

Commit 4a3bd3a

Browse files
committed
Update readme and fix #7
1 parent dc0d1e9 commit 4a3bd3a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
[![devDependency Status](https://david-dm.org/styfle/react-server-example-tsx/dev-status.svg)](https://david-dm.org/styfle/react-server-example-tsx#info=devDependencies)
77
[![Build Status](https://travis-ci.org/styfle/react-server-example-tsx.svg?branch=master)](https://travis-ci.org/styfle/react-server-example-tsx)
88

9+
<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/fnqaM5soqgNJruSNFm8pdqUw/styfle/react-server-example-tsx'>
10+
<img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/fnqaM5soqgNJruSNFm8pdqUw/styfle/react-server-example-tsx.svg' />
11+
</a>
12+
913
A complex example of how to do server-side rendering with
1014
[React](http://facebook.github.io/react/) and [TypeScript](https://www.typescriptlang.org/) so that component code can be shared between server and browser (also known as isomorphic javascript).
1115

@@ -25,6 +29,14 @@ npm start
2529

2630
Then navigate to http://localhost:3007 and click on the buttons to see some reactive events in action.
2731

32+
## Deployment
33+
34+
You can deploy with `now` by doing something like the following:
35+
36+
```sh
37+
npx now -e NODE_ENV=production styfle/react-server-example-tsx
38+
```
39+
2840
## Preventing XSS
2941

3042
The original code from `mhart` attempts to [sanitize the props](https://github.com/mhart/react-server-example/blob/feada6183fe2fbb1a746492e157febe49eeafdcd/server.js#L106) by escaping and then inserting into a `<script>` tag.

0 commit comments

Comments
 (0)