@worldsayshi/servant

0.0.8 • Public • Published

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

/@worldsayshi/servant/

    Package Sidebar

    Install

    npm i @worldsayshi/servant

    Weekly Downloads

    3

    Version

    0.0.8

    License

    ISC

    Unpacked Size

    11.8 MB

    Total Files

    49

    Last publish

    Collaborators

    • worldsayshi