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(',');
|
||||
if (blockchainConfig.rpcCorsDomain === 'auto') {
|
||||
blockchainConfig.rpcCorsDomain = cors;
|
||||
} else if (blockchainConfig.rpcCorsDomain.indexOf('auto') > -1) {
|
||||
blockchainConfig.rpcCorsDomain = blockchainConfig.rpcCorsDomain.replace('auto', cors);
|
||||
} else if (typeof blockchainConfig.rpcCorsDomain === 'object') {
|
||||
let tempCors = blockchainConfig.rpcCorsDomain.auto ? corsParts : [];
|
||||
tempCors = tempCors.concat(blockchainConfig.rpcCorsDomain.additionalCors || []);
|
||||
blockchainConfig.rpcCorsDomain = tempCors.join(',');
|
||||
}
|
||||
if (blockchainConfig.wsOrigins === 'auto') {
|
||||
blockchainConfig.wsOrigins = cors;
|
||||
} else if (blockchainConfig.wsOrigins.indexOf('auto') > -1) {
|
||||
blockchainConfig.wsOrigins = blockchainConfig.wsOrigins.replace('auto', cors);
|
||||
} else if (typeof blockchainConfig.wsOrigins === 'object') {
|
||||
let tempCors = blockchainConfig.wsOrigins.auto ? corsParts : [];
|
||||
tempCors = tempCors.concat(blockchainConfig.wsOrigins.additionalCors || []);
|
||||
blockchainConfig.wsOrigins = tempCors.join(',');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -4,11 +4,15 @@ module.exports = {
|
|||
enabled: true,
|
||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
||||
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)
|
||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||
rpcCorsDomain: { // Domains from which to accept cross origin requests (browser enforced). This can also be a comma separated list
|
||||
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
|
||||
wsOrigins: "auto", // Origins from which to accept websockets requests
|
||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||
wsOrigins: { // Same thing as "rpcCorsDomain", but for WS origins
|
||||
auto: true,
|
||||
additionalCors: []
|
||||
},
|
||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
||||
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
||||
|
||||
|
|
|
@ -4,11 +4,15 @@ module.exports = {
|
|||
enabled: true,
|
||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
||||
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)
|
||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||
rpcCorsDomain: { // Domains from which to accept cross origin requests (browser enforced). This can also be a comma separated list
|
||||
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
|
||||
wsOrigins: "auto", // Origins from which to accept websockets requests
|
||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||
wsOrigins: { // Same thing as "rpcCorsDomain", but for WS origins
|
||||
auto: true,
|
||||
additionalCors: []
|
||||
},
|
||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
||||
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
||||
|
||||
|
|
|
@ -4,11 +4,15 @@ module.exports = {
|
|||
enabled: true,
|
||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
||||
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)
|
||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||
rpcCorsDomain: { // Domains from which to accept cross origin requests (browser enforced). This can also be a comma separated list
|
||||
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
|
||||
wsOrigins: "auto", // Origins from which to accept websockets requests
|
||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||
wsOrigins: { // Same thing as "rpcCorsDomain", but for WS origins
|
||||
auto: true,
|
||||
additionalCors: []
|
||||
},
|
||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
||||
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue