mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-29 18:48:11 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user