// Module dependencies -- GLOBAL fs = require('fs'); execute = require('child_process').exec; // spawn = require('child_process').spawn; url = require('url'); express = require('express'); routes = require('./routes'); https = require('https'); path = require('path'); redis = require('redis'); RedisStore = require('connect-redis')(express); bcrypt = require('bcrypt'); prettyjson = require('prettyjson'); config = require('./config/config.js'); app = express(); redisClient = redis.createClient(); // all environments app.set('port', config.appPort || process.env.PORT); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.set('env', 'development'); app.use(express.favicon('./public/images/favicon.ico')); app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.cookieParser(config.secretKey)); app.use(express.session({ key: config.sessIDKey, store: new RedisStore({ port: config.redisPort, host: config.redisHost, db: config.redisDatabase, pass: config.redisPass, ttl: config.cookieLife / 1000 // redis ttl in SECONDS }), secret: config.secretKey, cookie: {path: '/', secure: true, signed: true, httpOnly: true} })); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(path.join(__dirname, 'public'))); // development only if ('development' == app.get('env')) { app.use(express.errorHandler()); } app.get('/', routes.index); app.get('/servers', routes.servers); app.post('/connect', routes.connect); app.post('/disconnect', routes.disconnect); app.get('/sessionInfo', routes.sessionInfo); redisClient.on('error', function(err){ console.log(err); }); redisClient.on('ready', function(){ console.log('Redis DB - Connection ready'); }); redisClient.on('end', function(){ console.log('Redis DB - Connection closed'); }); var options = { key: fs.readFileSync('./public/sslcert/key.pem').toString(), cert: fs.readFileSync('./public/sslcert/cert.pem').toString() }; https.createServer(options, app).listen(app.get('port'), function(){ // console.log(prettyjson.render(app.get('env'))); console.log('\nExpress server listening on port ' + app.get('port')); console.log(prettyjson.render(config)); });
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 8378 | Joe Robinson |
- Server modal working. - Simplified backbone data fetching. - Log out of perforce now and not just empty session. - TODO: - Prettier/different icons for each server type. - Modal image and parent/child list. |
||
#5 | 8373 | Joe Robinson |
- Moved to d3 to handle image drawing (SVG). - Proper sessions (logging in/out) implemented. - TODO: Fix server modal style/formatting & populate with data. |
||
#4 | 8371 | Joe Robinson |
Implemented cookies/sessions (still need logout functionality). Cleaned up logging window; delete older messages so new ones do not break the page. |
||
#3 | 8367 | Joe Robinson |
Improve backbone data retrieval functionality (for building canvas nodes). Connect/login modal working almost as desired. Draw basic things on canvas. Preliminary implementation of Redis DB/cookie saving. |
||
#2 | 8362 | Joe Robinson |
Basic backbone functionality. Removed user routes. |
||
#1 | 8356 | Joe Robinson |
Refactored files, old service version can be deleted. Improved base service structure. |