mirror of https://github.com/embarklabs/embark.git
config -- canonicalHost, defaultHost
This commit is contained in:
parent
6d482cfb95
commit
3885128e18
|
@ -5,6 +5,7 @@ const utils = require('../utils/utils.js');
|
|||
const path = require('path');
|
||||
const deepEqual = require('deep-equal');
|
||||
const constants = require('../constants');
|
||||
const {canonicalHost, defaultHost} = require('../utils/host');
|
||||
|
||||
var Config = function(options) {
|
||||
const self = this;
|
||||
|
@ -106,6 +107,9 @@ Config.prototype._updateBlockchainCors = function(){
|
|||
// remove /ipfs or /bzz: from getUrl if it's there
|
||||
let getUrlParts = storageConfig.upload.getUrl.split('/');
|
||||
getUrlParts = getUrlParts.slice(0, 3);
|
||||
let host = canonicalHost(getUrlParts[2].split(':')[0]);
|
||||
let port = getUrlParts[2].split(':')[1];
|
||||
getUrlParts[2] = port ? [host, port].join(':') : host;
|
||||
corsParts.push(getUrlParts.join('/'));
|
||||
}
|
||||
// use our modified getUrl or in case it wasn't specified, use a built url
|
||||
|
@ -246,7 +250,7 @@ Config.prototype.loadStorageConfigFile = function() {
|
|||
"upload": {
|
||||
"provider": "ipfs",
|
||||
"protocol": "http",
|
||||
"host": "localhost",
|
||||
"host" : defaultHost,
|
||||
"port": 5001,
|
||||
"getUrl": "http://localhost:8080/ipfs/"
|
||||
},
|
||||
|
@ -281,7 +285,9 @@ Config.prototype.loadCommunicationConfigFile = function() {
|
|||
"provider": "whisper",
|
||||
"available_providers": ["whisper"],
|
||||
"connection": {
|
||||
"host": "localhost", "port": 8546, "type": "ws"
|
||||
"host": defaultHost,
|
||||
"port": 8546,
|
||||
"type": "ws"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -293,7 +299,9 @@ Config.prototype.loadCommunicationConfigFile = function() {
|
|||
|
||||
Config.prototype.loadWebServerConfigFile = function() {
|
||||
var configObject = {
|
||||
"enabled": true, "host": "localhost", "port": 8000
|
||||
"enabled": true,
|
||||
"host": defaultHost,
|
||||
"port": 8000
|
||||
};
|
||||
|
||||
let configFilePath = this._getFileOrOject(this.configDir, 'webserver', 'webserver');
|
||||
|
|
Loading…
Reference in New Issue