Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mattias J Duffy
schedules
Commits
1972326f
Unverified
Commit
1972326f
authored
Jul 25, 2016
by
Mark Stenglein
Browse files
Add redis support
parent
f97db970
Changes
3
Hide whitespace changes
Inline
Side-by-side
schedules/app.js
View file @
1972326f
...
...
@@ -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
();
...
...
schedules/models/Semester.js
View file @
1972326f
...
...
@@ -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
);
...
...
schedules/package.json
View file @
1972326f
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment