Created
June 27, 2014 05:45
-
-
Save metasansana/0c2d90406ea3fa333b1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Here is a simple example. Pretend we are using express. | |
var app = express(); | |
var config; | |
var db = new ConfigServerThing(); | |
//This part is useless because the main loop exits before we call app.listen() | |
db.find(function(err, config) { | |
if(err) throw err; | |
config = config; | |
app.listen(3000); | |
}); | |
app.get('/', function(req,res) { | |
if(config.SHOW_ROOT) | |
return res.send('root'); | |
res.send(404); | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment