-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
61 lines (48 loc) · 1.42 KB
/
app.js
1
2
//--------------------------------------------------------------// Standard setup//config filevar config = require('./config');//log systemvar log = require('logly');log.name(config.name);log.colour(true);if(config.debug) log.mode('debug');else log.mode('standard');//live wall servervar livewall = require('./server');
//express web applicationvar express = require('express');//web server instancevar server = express.createServer();//socket.io instancevar io = require('socket.io').listen(server);if(!config.debug){ io.disable('log'); io.set("browser client minification", true);}//stop rendering layout every timeserver.set("view options", { layout: false });//sets the view engine to render pages with jadeserver.set('view engine', 'jade');//this allows forms to be encoded to req.bodyserver.use(express.bodyParser());//--------------------------------------------------------------//start everything!livewall.init(server, io, function(err) { if(err) { log.error("Error init-ing " + config.name); log.error(err); process.exit(-1); } else { server.listen(config.web.port); log.log("Started " + config.name + " (" + config.version + ")"); if(config.web.port != 80) log.log("on " + config.web.servername + ":" + config.web.port + "/"); else log.log("on " + config.web.servername + "/"); }});