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:
@ -16,6 +16,7 @@ var getUsernameFromProvider = require('./utils/auth').getUsernameFromProvider;
|
||||
var generateKey =
|
||||
require('loopback-component-passport/lib/models/utils').generateKey;
|
||||
|
||||
var isBeta = !!process.env.BETA;
|
||||
var app = loopback();
|
||||
|
||||
expressState.extend(app);
|
||||
@ -96,10 +97,13 @@ app.start = function() {
|
||||
app.listen(app.get('port'), function() {
|
||||
app.emit('started');
|
||||
console.log(
|
||||
'FreeCodeCamp server listening on port %d in %s mode',
|
||||
'FreeCodeCamp server listening on port %d in %s',
|
||||
app.get('port'),
|
||||
app.get('env')
|
||||
);
|
||||
if (isBeta) {
|
||||
console.log('Free Code Camp is in beta mode');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user