1
votes

I am unable to access my react app running on dev environment from another machine in the same network. what setting is wrong here? Where should I specify that? In my localhost it runs in port 3000, my machine's internal ip is 10.0.1.3, so when I try http://10.0.1.3:3000 from any other machines in this network, it just does not work. Here is my package.json:

    {
  "name": "delivery",
  "description": "delivery system",
  "scripts": {
    "start": "run-p start:dev start:api",
    "start:dev": "webpack-dev-server --config webpack.config.dev.js --port 3000",
    "prestart:api": "node tools/createMockDb.js",
    "start:api": "node tools/apiServer.js"
  },
  "dependencies": {
    "list of dependiences"
  },
  "devDependencies": {
    "list of dev dependencies"
  },
  "engines": {
    "node": ">=8"
  },
  "babel": {
    "presets": [
      "babel-preset-react-app"
    ]
  },
    "env": {
      "browser": true,
      "node": true,
      "es6": true,
      "jest": true
    },
    "rules": {
      "no-debugger": "off",
      "no-console": "off",
      "no-unused-vars": "warn",
      "react/prop-types": "warn"
    },
    "settings": {
      "react": {
        "version": "detect"
      }
    },
    "root": true
  }
}
1
you need to configure your firewall to allow it to accept requests at 3000 port - Sujit.Warrier
are you using windows? - Sujit.Warrier
it is mac, the firewall is configured to accept requests - Nodir Nasirov

1 Answers

0
votes

Try to add this to Your webpack.config.js file and set the port whatever You want, in this case I set it 5555:

devServer: {
    inline:true,
    port: 5555     
  }