Commit d630efb2 authored by Matthew Taylor's avatar Matthew Taylor

Add `shouldFallback` process env variable

So that it's clear to newcomers what things are not yet completed in scratch-www as we build it out.
parent cf2a5cc4
......@@ -30,8 +30,12 @@ Use `^C` to stop the node process `npm start` starts.
| `API_HOST` | `https://api.scratch.mit.edu` | Hostname for API requests |
| `NODE_ENV` | `null` | If not `production`, app acts like development |
| `PORT` | `8333` | Port for devserver (http://localhost:XXXX) |
| `FALLBACK` | `false` | Whether or not to fallback to `PROXY_HOST` for non-existent pages/reqeusts |
| `PROXY_HOST` | `https://scratch.mit.edu` | Pass-through location for scratchr2 |
#### Current issues with the development
* Login does not work (*In the process of being fixed*)
### To Test
```bash
npm test
......
......@@ -79,10 +79,13 @@ if (!isProduction) {
}
}));
var shouldFallback = (process.env.FALLBACK === 'true') || false;
if (shouldFallback) {
// Fall back to scratchr2 in development
// This proxy middleware must come last
var proxyHost = process.env.PROXY_HOST || 'https://scratch.mit.edu';
app.use('/', proxy(proxyHost));
}
}
// Start listening
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment