What is it?
It's a very simple nodejs server that render React app to HTML string.
Features
- Render React bundle into HTML string;
- Uses React Router V4;
- React Redux support;
- JSS support;
- React Material UI support;
- Static files serving support;
- Made with TypeScript;
- Can be easily builded with Babel;
- Supports Axios on client
Usage example
IMPORTANT! This package requires babel-polyfill
for correct work!
Install package with
npm i --save @archangel63/react-render-server
commandCreate your
server.js
file with the following content: ` require("babel-polyfill");require("@archangel63/react-render-server").run(5001, {
baseDir: __dirname, mode: "render"
}); `
Run it with
node server.js
Pass requests to the
http://localhost:5001
with HTTP headerX-LOCAL-HOST: *your api server address*
License
MIT