@worldsayshi/servant
v0.0.8
Published
Command line interface that serves a react component with server and client side rendering.
Downloads
1
Readme
Servant
Serve a React component with a CLI
Command line interface that serves a react component with server and client side rendering.
Currently the component needs to be compiled to UMD. See below and examples/hello-world-typescript
.
Usage
Install servant:
$ npm install -g @worldsayshi/servant
Run the example:
$ cd examples/hello-world-typescript
$ npm install
$ servant dist/helloWorld.js
The react component will be served at http://localhost:3000 by default.
Multiple components
$ (cd examples/show-components && npm run prepare)
$ servant examples/show-components/dist/
Then go to any of these:
http://localhost:3000/evergreen-autocomplete-example.tsx.js http://localhost:3000/svg.tsx.js
Developing
Build on change
npm run watch
Restart on change
npm run watch-run -- examples/hello-world-typescript/dist/helloWorld.js