Skip to content

Instantly share code, notes, and snippets.

@mathamoz
Created March 14, 2016 14:22
Show Gist options
  • Save mathamoz/1f4f924b24e5e2a98779 to your computer and use it in GitHub Desktop.
Save mathamoz/1f4f924b24e5e2a98779 to your computer and use it in GitHub Desktop.
FS Node Express
var express = require('express');
var featureswitches = require('featureswitches')('customer_key', 'environment_key');
var app = express();
featureswitches.sync();
app.get('/', function(req, res) {
featureswitches.is_enabled('world')
.then(function(result) {
if (result instanceof Error) {
res.send('Error...');
} else {
if(result == true) {
res.send('Hello World!');
} else {
res.send('Hello USA!');
}
}
});
});
app.listen(3000, function() {
console.log('Listening on port 3000!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment