add CORS for CRA port 3000

This commit is contained in:
emizzle 2019-05-24 08:26:56 +07:00
parent 935d99c83f
commit 910884c6d5
No known key found for this signature in database
GPG Key ID: 1FD4BAB3C37EE9BA
2 changed files with 9 additions and 3 deletions

View File

@ -4,10 +4,16 @@ 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)
rpcCorsDomain: {
auto: true,
additionalCors: ["http://localhost:3000"]
}, // 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
wsRPC: true, // Enable the WS-RPC server
wsOrigins: "auto", // Origins from which to accept websockets requests
wsOrigins: {
auto: true,
additionalCors: ["http://localhost:3000"]
}, // Origins from which to accept websockets requests
// When set to "auto", Embark will automatically set the cors to the address of the webserver
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
wsPort: 8546 // WS-RPC server listening port (default: 8546)

View File

@ -32,7 +32,7 @@
"react-scripts": "2.1.8"
},
"scripts": {
"start": "PORT=3001 react-scripts start",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "embark test",
"eject": "react-scripts eject"