-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow user configuration of primus, document usage
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,44 @@ | ||
# trailpack-realtime | ||
:package: Realtime Trailpack. Synchronize the client and server via WebSockets | ||
|
||
## Getting Started | ||
|
||
### Install | ||
|
||
```js | ||
npm install --save trailpack-realtime | ||
``` | ||
|
||
Then edit `config/main.js ` | ||
|
||
```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 ` | ||
|
||
```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> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters