mirror of https://github.com/embarklabs/embark.git
change to use an object instead and change templates
This commit is contained in:
parent
9e349ff267
commit
1bafc41d97
|
@ -165,13 +165,17 @@ Config.prototype._updateBlockchainCors = function(){
|
||||||
let cors = corsParts.join(',');
|
let cors = corsParts.join(',');
|
||||||
if (blockchainConfig.rpcCorsDomain === 'auto') {
|
if (blockchainConfig.rpcCorsDomain === 'auto') {
|
||||||
blockchainConfig.rpcCorsDomain = cors;
|
blockchainConfig.rpcCorsDomain = cors;
|
||||||
} else if (blockchainConfig.rpcCorsDomain.indexOf('auto') > -1) {
|
} else if (typeof blockchainConfig.rpcCorsDomain === 'object') {
|
||||||
blockchainConfig.rpcCorsDomain = blockchainConfig.rpcCorsDomain.replace('auto', cors);
|
let tempCors = blockchainConfig.rpcCorsDomain.auto ? corsParts : [];
|
||||||
|
tempCors = tempCors.concat(blockchainConfig.rpcCorsDomain.additionalCors || []);
|
||||||
|
blockchainConfig.rpcCorsDomain = tempCors.join(',');
|
||||||
}
|
}
|
||||||
if (blockchainConfig.wsOrigins === 'auto') {
|
if (blockchainConfig.wsOrigins === 'auto') {
|
||||||
blockchainConfig.wsOrigins = cors;
|
blockchainConfig.wsOrigins = cors;
|
||||||
} else if (blockchainConfig.wsOrigins.indexOf('auto') > -1) {
|
} else if (typeof blockchainConfig.wsOrigins === 'object') {
|
||||||
blockchainConfig.wsOrigins = blockchainConfig.wsOrigins.replace('auto', cors);
|
let tempCors = blockchainConfig.wsOrigins.auto ? corsParts : [];
|
||||||
|
tempCors = tempCors.concat(blockchainConfig.wsOrigins.additionalCors || []);
|
||||||
|
blockchainConfig.wsOrigins = tempCors.join(',');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,15 @@ module.exports = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
||||||
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
||||||
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
rpcCorsDomain: { // Domains from which to accept cross origin requests (browser enforced). This can also be a comma separated list
|
||||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
auto: true, // When "auto" is true, Embark will automatically set the cors to the address of the webserver
|
||||||
|
additionalCors: [] // Additional CORS domains to add to the list. If "auto" is false, only those will be added
|
||||||
|
},
|
||||||
wsRPC: true, // Enable the WS-RPC server
|
wsRPC: true, // Enable the WS-RPC server
|
||||||
wsOrigins: "auto", // Origins from which to accept websockets requests
|
wsOrigins: { // Same thing as "rpcCorsDomain", but for WS origins
|
||||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
auto: true,
|
||||||
|
additionalCors: []
|
||||||
|
},
|
||||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
||||||
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,15 @@ module.exports = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
||||||
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
||||||
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
rpcCorsDomain: { // Domains from which to accept cross origin requests (browser enforced). This can also be a comma separated list
|
||||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
auto: true, // When "auto" is true, Embark will automatically set the cors to the address of the webserver
|
||||||
|
additionalCors: [] // Additional CORS domains to add to the list. If "auto" is false, only those will be added
|
||||||
|
},
|
||||||
wsRPC: true, // Enable the WS-RPC server
|
wsRPC: true, // Enable the WS-RPC server
|
||||||
wsOrigins: "auto", // Origins from which to accept websockets requests
|
wsOrigins: { // Same thing as "rpcCorsDomain", but for WS origins
|
||||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
auto: true,
|
||||||
|
additionalCors: []
|
||||||
|
},
|
||||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
||||||
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,15 @@ module.exports = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
||||||
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
||||||
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
rpcCorsDomain: { // Domains from which to accept cross origin requests (browser enforced). This can also be a comma separated list
|
||||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
auto: true, // When "auto" is true, Embark will automatically set the cors to the address of the webserver
|
||||||
|
additionalCors: [] // Additional CORS domains to add to the list. If "auto" is false, only those will be added
|
||||||
|
},
|
||||||
wsRPC: true, // Enable the WS-RPC server
|
wsRPC: true, // Enable the WS-RPC server
|
||||||
wsOrigins: "auto", // Origins from which to accept websockets requests
|
wsOrigins: { // Same thing as "rpcCorsDomain", but for WS origins
|
||||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
auto: true,
|
||||||
|
additionalCors: []
|
||||||
|
},
|
||||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
||||||
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue