Add ability to filter beta challenges from production
This PR adds the ability to test out challenges in beta without fear that they will leak to production servers. In development all challenges will display. In production all challenges marked 'isBeta' will be filtered out except in the case the environmental variable `BETA` is set ture, in which case all challenges will display.
This commit is contained in:
2
index.js
2
index.js
@ -43,6 +43,7 @@ Challenge.destroyAll(function(err, info) {
|
||||
var challengeSpec = require('./challenges/' + file);
|
||||
var order = challengeSpec.order;
|
||||
var block = challengeSpec.name;
|
||||
var isBeta = !!challengeSpec.isBeta;
|
||||
|
||||
// challenge file has no challenges...
|
||||
if (challengeSpec.challenges.length === 0) {
|
||||
@ -66,6 +67,7 @@ Challenge.destroyAll(function(err, info) {
|
||||
challenge.order = order;
|
||||
challenge.suborder = index + 1;
|
||||
challenge.block = block;
|
||||
challenge.isBeta = challenge.isBeta || isBeta;
|
||||
|
||||
return challenge;
|
||||
});
|
||||
|
Reference in New Issue
Block a user