Add redis support

parent f97db970
......@@ -4,6 +4,7 @@ var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var mongooseRedisCache = require("mongoose-redis-cache");
// Load site wide configurations
var config = require('./config');
......@@ -31,6 +32,8 @@ app.use(express.static(path.join(__dirname, 'public')));
// Connect to mongo
mongoose.connect(config.mongoDBURL);
mongooseRedisCache(mongoose)
// Populate initial data
var populateDB = require('./setup/populateDB');
populateDB();
......
......@@ -29,6 +29,8 @@ var semesterSchema = new Schema({
]
});
semesterSchema.set('redisCache', true)
// the schema is useless so far
// we need to create a model using it
var Semester = mongoose.model('Semester', semesterSchema);
......
......@@ -12,6 +12,7 @@
"express": "~4.13.4",
"jade": "~1.11.0",
"mongoose": "^4.5.5",
"mongoose-redis-cache": "0.0.3",
"morgan": "~1.7.0",
"node-sass": "^3.8.0",
"node-sass-middleware": "0.8.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment