Před trasami budete muset vytvořit instanci relací.
var express = require('express'),
RedisStore = require('connect-redis')(express),
Config = require('./config/config'),
cluster = require("cluster"),
QueryManager = require('./service/query_manager'),
app = express();
app.use(express.cookieParser());
app.use(express.session({
store: new RedisStore({
host: Config.redis.host,
port: Config.redis.port
}),
secret: 'Its a secret.',
cookie: { secure: true }
}));
// --- Index --- //
function renderSplash(req, res) {
res.render(...);
}
function renderIndex(req, res) {
res.render(...);
}
app.get('/', function(req, res) {
if(req.session.user === null) {
renderSplash(req, res);
} else {
renderIndex(req, res);
}
});