Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jaumard authored and jaumard committed Nov 20, 2017
1 parent 432eeb3 commit c8a8d2a
Show file tree
Hide file tree
Showing 5 changed files with 1,109 additions and 16 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_js:
- 5
- 6
- 7
- 8
notifications:
email: false
webhooks:
Expand Down
Empty file removed api/index.js
Empty file.
20 changes: 11 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,30 @@ const primusDefaults = {
}

module.exports = class Realtime extends Trailpack {
validate () {
validate() {
return Promise.resolve()
}

configure () {
configure() {
return Promise.resolve()
}

initialize () {
return new Promise((res,rej)=>{
this.app.once('webserver:http:ready',(httpServer)=>{
const primusConfig = _.get(this.app.config,'realtime.primus',{options: {}})
this.app.sockets = new Primus(httpServer,Object.assign(primusDefaults,primusConfig.options))
initialize() {
return new Promise((res, rej) => {
this.app.once('webserver:http:ready', (httpServer) => {
if (Array.isArray(httpServer)) {
httpServer = httpServer[0]
}
const primusConfig = _.get(this.app.config, 'realtime.primus', { options: {} })
this.app.sockets = new Primus(httpServer, Object.assign(primusDefaults, primusConfig.options))
res()
})
})
}

constructor (app) {
constructor(app) {
super(app, {
config: require('./config'),
api: require('./api'),
pkg: require('./package')
})
}
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trailpack-realtime",
"version": "2.0.0",
"version": "2.1.0",
"description": "Realtime Trailpack. Synchronize the client and server via WebSockets",
"homepage": "http://www.trailsjs.io/",
"author": "Trails.js Team <[email protected]>",
Expand All @@ -27,14 +27,14 @@
"primus"
],
"dependencies": {
"engine.io": "^1.8.2",
"primus": "^6.0.9",
"trailpack": "^2.1.0"
"engine.io": "^3.1.4",
"primus": "^7.1.0",
"trailpack": "^2.1.3"
},
"devDependencies": {
"eslint": "^3.13.1",
"eslint-config-trails": "^2.0.6",
"mocha": "^3.2.0"
"eslint": "^4.11.0",
"eslint-config-trails": "^3.0.0",
"mocha": "^4.0.1"
},
"scripts": {
"test": "eslint ."
Expand Down
Loading

0 comments on commit c8a8d2a

Please sign in to comment.