diff --git a/src/cli/standalone-daemon.js b/src/cli/standalone-daemon.js index fde604241e..e4d9c5c541 100644 --- a/src/cli/standalone-daemon.js +++ b/src/cli/standalone-daemon.js @@ -69,7 +69,7 @@ class StandaloneDaemon { this._ipfs = ipfs // start HTTP servers (if API or Gateway is enabled in options) - const httpApi = new HttpApi(ipfs, ipfsOpts) + const httpApi = new HttpApi(ipfs, Object.assign({ announceListeners: true }, ipfsOpts)) this._httpApi = await httpApi.start() this._log('started') diff --git a/src/http/index.js b/src/http/index.js index 69b305d43e..330ed923bd 100644 --- a/src/http/index.js +++ b/src/http/index.js @@ -77,14 +77,15 @@ class HttpApi { const gatewayAddrs = config.Addresses.Gateway this._gatewayServers = await serverCreator(gatewayAddrs, this._createGatewayServer, ipfs) + const announce = this._options.announceListeners ? ipfs._print : this._log this._apiServers.forEach(apiServer => { - ipfs._print('API listening on %s', apiServer.info.ma) + announce('API listening on %s', apiServer.info.ma.toString()) }) this._gatewayServers.forEach(gatewayServer => { - ipfs._print('Gateway (read only) listening on %s', gatewayServer.info.ma) + announce('Gateway (read only) listening on %s', gatewayServer.info.ma.toString()) }) this._apiServers.forEach(apiServer => { - ipfs._print('Web UI available at %s', toUri(apiServer.info.ma) + '/webui') + announce('Web UI available at %s', toUri(apiServer.info.ma) + '/webui') }) this._log('started') return this