diff --git a/.env.sample b/.env.sample deleted file mode 100644 index f997341d1..000000000 --- a/.env.sample +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV=development -PROXY_HOST=http://localhost -PROXY_PORT=8080 diff --git a/README.md b/README.md index aef6d4798..1097eaf40 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,16 @@ npm start Once running, open `http://localhost:8333` in your browser. If you wish to have the server reload automatically, you can install either [nodemon](https://github.com/remy/nodemon) or [forever](https://github.com/foreverjs/forever). +#### Configuration + +`npm start` and `npm run watch` can be configured with the following environment variables + +| Variable | Default | Description | +| ------------- | --------------------------------- | ---------------------------------------------- | +| `NODE_ENV` | `null` | If not `production`, app acts like development | +| `PORT` | `8333` | Port for devserver (http://localhost:XXXX) | +| `PROXY_HOST` | `https://staging.scratch.mit.edu` | Pass-through location for scratchr2 | + ### To Test ```bash npm test diff --git a/server/index.js b/server/index.js index c313ce1f4..b4bc9c7e1 100644 --- a/server/index.js +++ b/server/index.js @@ -27,8 +27,7 @@ for (var routeId in routes) { if ( process.env.NODE_ENV != 'production' ) { var proxies = require('./proxies.json'); var url = require('url'); - var proxyHost = process.env.PROXY_HOST || 'http://localhost'; - proxyHost += ':' + (process.env.PROXY_PORT || 8080); + var proxyHost = process.env.PROXY_HOST || 'https://staging.scratch.mit.edu'; for (var proxyId in proxies) { var proxyRoute = proxies[proxyId]; app.use(proxyRoute.root, proxy(proxyRoute.proxy || proxyHost, {