diff --git a/README.md b/README.md index 4a0996e7..96a72fbc 100644 --- a/README.md +++ b/README.md @@ -93,13 +93,18 @@ After installation, you can run the Sequence Tube Map: npm run serve ``` Note that this is using **npm**, not **nvm** as in the previous step. + + If you get an `EADDRINUSE` error, try picking a different server port (and update all the numbers below from 3000 to whatever you picked). + ``` + SERVER_PORT=3001 npm run serve + ``` 5. Open the Sequence Tube Map in your browser. - - If you are running the Sequence Tube Map on your local computer, you can visit [http://localhost:3001](http://localhost:3001). - - If you are running the Sequence Tube Map on a *different* computer (for example, one accessed by SSH), you will need to connect to it there. You can try browsing to port 3001 on that machine's hostname. For example, if you connected with `ssh yourname@bigserver.example.edu`, then `bigserver.example.edu` is the hostname, and you want to visit `http://bigserver.example.edu:3001`. If that doesn't work, you can try setting up an SSH tunnel by making a second SSH connection with: + - If you are running the Sequence Tube Map on your local computer, you can visit [http://localhost:3000](http://localhost:3000). + - If you are running the Sequence Tube Map on a *different* computer (for example, one accessed by SSH), you will need to connect to it there. You can try browsing to port 3000 on that machine's hostname. For example, if you connected with `ssh yourname@bigserver.example.edu`, then `bigserver.example.edu` is the hostname, and you want to visit `http://bigserver.example.edu:3000`. If that doesn't work, you can try setting up an SSH tunnel by making a second SSH connection with: ``` - ssh -L 3001:localhost:3001 yourname@bigserver.example.edu + ssh -L 3000:localhost:3000 yourname@bigserver.example.edu ``` - While that SSH connection is open, you will be able to see the Sequence Tube Map at [http://localhost:3001](http://localhost:3001). + While that SSH connection is open, you will be able to see the Sequence Tube Map at [http://localhost:3000](http://localhost:3000). ### Setting Up a Visualization diff --git a/doc/development.md b/doc/development.md index f81ed911..b8f3c568 100644 --- a/doc/development.md +++ b/doc/development.md @@ -12,7 +12,7 @@ The `npm run build`/`npm run serve` pipeline can only produce minified code, whi ``` npm run start ``` -This will use React's development mode server to serve the frontend, and run the backend in a separate process, behind React's proxy. Local ports 3000 (or set a different SERVER_PORT in .env) and 3001 must both be free. +This will use React's development mode server to serve the frontend, and run the backend in a separate process, behind React's proxy. Local ports 3000 and 3001 must both be free. You can change these with the `SERVER_PORT` environment variable or `.env` setting, or the `serverPort` field in `config.json`, and the `PORT` environment variable. Running in this mode allows the application to produce human-readable stack traces when something goes wrong in the browser. diff --git a/src/setupProxy.js b/src/setupProxy.js index 02eb679f..106f72c5 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -23,7 +23,7 @@ module.exports = function (app) { "http://" + addressToHost(config.serverBindAddress) + ":" + - (process.env.SERVER_PORT || "3000"); + (process.env.SERVER_PORT || config.serverPort || "3000"); app.use(createProxyMiddleware(serverBase + "/api")); // Websockets don't seem to get through unless we ask for them explicitly. // They can just go to the root because the server ignores websocket paths.