Collect all env vars in one, easy-to-find place (#1149)

* Collect all env vars in one, easy-to-find place

Past state:
* Default environement variables were stored in both client/package.json
and client/__tests__/e2e/config.js
* Constants that should have been linked--like the cellxgene server port
during testing--were repeated.

With this commit:
* All environment variables are parameterized
* All environment variables are packaged in default env files

* Move npm scripts to client Makefile

* Respond to feedback from @seve and @bkmartinjr
This commit is contained in:
Matt Weiden
2020-02-12 12:50:48 -08:00
committed by GitHub
parent 5340a5f951
commit ac13b31e13
16 changed files with 777 additions and 287 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ var utils = require("./utils");
process.env.NODE_ENV = "development";
var PORT = process.env.PORT || 3000;
const CLIENT_PORT = process.env.CXG_CLIENT_PORT;
// Set up compiler
var compiler = webpack(config);
@@ -22,7 +22,7 @@ compiler.plugin("invalid", () => {
});
compiler.plugin("done", stats => {
utils.formatStats(stats, PORT);
utils.formatStats(stats, CLIENT_PORT);
});
// Launch server
@@ -43,7 +43,7 @@ app.get("*", (req, res) => {
res.sendFile(path.resolve("index.html"));
});
app.listen(PORT, err => {
app.listen(CLIENT_PORT, err => {
if (err) {
console.log(err);
return;