React Render server used by Django to render JSX files server side. Works with Redux.
Current version of node is 7.5, but should be usable by node >= 5.
To get started with React Render server you can simply install it with npm:
npm install --save react-render-server
Run the script in bin
or start with node render-server
when globally installed.
Pass a JSON encoded object to serializedProps on the body. If the props
contain storePath
it will try and import that path as the store.
This requires components that you want to render to have the "store" prop.
Send a JSON POST to /render
on the selected port with the JSON body as followed
{
"path": "/Your/Absolute/Path/To/The/Component/react.jsx",
"serializedProps": "{\"test\": \"Hello\"}"
}
or with normal props:
{
"path": "/Your/Absolute/Path/To/The/Component/react.jsx",
"props": {"test": "Hello"}
}
POST to /render
{
"path": "/Users/veldman/projects/django-react/render-server/lib/__mock__/react.jsx",
"serializedProps": "{\"test\": \"Hello\", \"storePath\": \"/Path/To/Store/store.js\"}"
}
For all commands enter the help flag:
node render-server --help
See React Render and Python React.