Skip to content

Commit

Permalink
refactor: use echo-server start and stop functions as promises (ipfs#…
Browse files Browse the repository at this point in the history
…1191)

* refactor: use echo-server start and stop functions as promises

* chore: update interface-ipfs-core version
  • Loading branch information
Pedro Santos authored and Alan Shaw committed Dec 2, 2019
1 parent f77819c commit e8a32a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 4 additions & 7 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
'use strict'

const promisify = require('promisify-es6')
const createServer = require('ipfsd-ctl').createServer
const EchoServer = require('interface-ipfs-core/src/utils/echo-http-server')
const server = createServer()
const echoServer = EchoServer.createServer()

const echoServerStart = promisify(echoServer.start)
const echoServerStop = promisify(echoServer.stop)
module.exports = {
bundlesize: { maxSize: '246kB' },
webpack: {
Expand All @@ -27,20 +24,20 @@ module.exports = {
},
hooks: {
node: {
pre: () => echoServerStart(),
post: () => echoServerStop()
pre: () => echoServer.start(),
post: () => echoServer.stop()
},
browser: {
pre: () => {
return Promise.all([
server.start(),
echoServerStart()
echoServer.start()
])
},
post: () => {
return Promise.all([
server.stop(),
echoServerStop()
echoServer.stop()
])
}
}
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@
"cross-env": "^6.0.0",
"detect-node": "^2.0.4",
"go-ipfs-dep": "^0.4.22",
"interface-ipfs-core": "^0.123.0",
"interface-ipfs-core": "^0.124.0",
"ipfsd-ctl": "^0.47.1",
"ndjson": "^1.5.0",
"nock": "^11.4.0",
"promisify-es6": "^1.0.3",
"pull-stream": "^3.6.14",
"pump": "^3.0.0",
"stream-equal": "^1.1.1"
Expand Down

0 comments on commit e8a32a7

Please sign in to comment.