2.0.0 • Published 7 years ago

trailpack-realtime v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

trailpack-realtime

:package: Realtime Trailpack. Synchronize the client and server via WebSockets

Getting Started

Install

npm install --save trailpack-realtime

Then edit config/main.js

packs: [
    require('trailpack-core'),
    require('trailpack-repl'),
    require('trailpack-router'),
    require('trailpack-express'), 
    require('trailpack-realtime')
  ],

Configure

Create the config file: config/realtime.js

module.exports = {
  primus:{
    options:{
      //these options are passed directly to the Primus constructor: https://github.com/primus/primus#getting-started
    }
  } 
};

Client

You can include the primus client library as a script:

<script src="/primus/primus.js"></script>