Use variable to store active sessions

Keep session data in process for as long as the TCP connectoin is
open. Use redis if connection closes before the session is over.
This commit is contained in:
Zaid Abdulla committed 2016-08-29 00:17:01 -07:00
1 parent e6aab4229d
commit 41fb97adef
3 files changed
+98 -67

No files matched your search

+4
View File
@@ -30,6 +30,7 @@ port = config.get("#{service.toUpperCase()}_PORT")
useHttps = config.get("#{service.toUpperCase()}_SSL")
serviceListener = require("./#{service}").listener
onConnection = require("./#{service}").onConnection
server = null
@@ -77,6 +78,9 @@ if useHttps
else
server = require('http').createServer(listener)
if onConnection?
server.on('connection', onConnection)
db.connect((err) ->
throw err if err
server.listen(port, networkInterface)