Skip to content

Instantly share code, notes, and snippets.

@glongman
Created August 28, 2010 04:27
Show Gist options
  • Save glongman/554715 to your computer and use it in GitHub Desktop.
Save glongman/554715 to your computer and use it in GitHub Desktop.
diff --git a/monitor.js b/monitor.js
index 6f6d4ec..bc89c96 100644
--- a/monitor.js
+++ b/monitor.js
@@ -19,9 +19,11 @@ db.open(function(p_db) {
app.configure(function(){
app.set('root', __dirname);
app.set('db', db);
- app.use(express.staticProvider(__dirname + "public"));
- app.use(express.cookieDecoder);
+ app.use(express.staticProvider(__dirname + "/public"));
+ //app.use(express.cookieDecoder);
app.use(express.logger());
+ app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
+
try {
var configJSON = fs.readFileSync(__dirname + "/config/app.json");
@@ -34,12 +36,13 @@ db.open(function(p_db) {
var config = JSON.parse(configJSON.toString());
//this.server.port = config.monitor_port;
- app.port = config.monitor_port;
+ //app.port = config.monitor_port;
for(var i in config) {
app.set(i, config[i]);
}
+ app.set('monitor_port', config.monitor_port);
});
app.get('/', function(){
@@ -91,11 +94,11 @@ db.open(function(p_db) {
});
});
- app.listen();
+ app.listen(app.set('monitor_port'));
});
var authenticate = function(req) {
- if(set('password') != req.cookies['not_secret']) {
- req.redirect('/login');
- }
+ // if(set('password') != req.cookies['not_secret']) {
+ // req.redirect('/login');
+ // }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment