📦 Realtime Trailpack. Synchronize the client and server via WebSockets
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')
],
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
}
}
};
You can include the primus client library as a script:
<script src="/primus/primus.js"></script>