Integrated configuration variables into the app.
Also renamed config().links to config().linkbar
This commit is contained in:
parent
86998dac7a
commit
cc2e7cf806
|
@ -22,7 +22,7 @@ module.exports = function () {
|
||||||
'15:40 - 16:40'
|
'15:40 - 16:40'
|
||||||
],
|
],
|
||||||
'school_id' : 934,
|
'school_id' : 934,
|
||||||
'links' : {
|
'linkbar' : {
|
||||||
'Login': ['http://roosters5.gepro-osi.nl/roosters/rooster.php?school=INSERTYOURSCHOOL_ID', '#CCCC99'],
|
'Login': ['http://roosters5.gepro-osi.nl/roosters/rooster.php?school=INSERTYOURSCHOOL_ID', '#CCCC99'],
|
||||||
'Magister': ['http://INSERTYOURMAGISTER.magister.net', '#0C5489'],
|
'Magister': ['http://INSERTYOURMAGISTER.magister.net', '#0C5489'],
|
||||||
'Mail': ['https://login.microsoftonline.com/', '#C41824']
|
'Mail': ['https://login.microsoftonline.com/', '#C41824']
|
||||||
|
|
9
web.js
9
web.js
|
@ -17,13 +17,16 @@ app.set('view engine', 'jade');
|
||||||
config().env == 'dev' ? app.disable('view cache') : null; //If the environment is set on 'dev' then view cache should be disabled.
|
config().env == 'dev' ? app.disable('view cache') : null; //If the environment is set on 'dev' then view cache should be disabled.
|
||||||
app.set('views', __dirname + '/resources/jade');
|
app.set('views', __dirname + '/resources/jade');
|
||||||
|
|
||||||
|
//Give the app some configuration information
|
||||||
|
app.local.linkbar = config().linkbar;
|
||||||
|
app.local.hour_times = config().hour_times;
|
||||||
|
|
||||||
//Set up all static directories for getting resources.
|
//Set up all static directories for getting resources.
|
||||||
app.use('/css', less(__dirname + '/resources/less'));
|
app.use('/css', less(__dirname + '/resources/less'));
|
||||||
app.use('/js', express.static(__dirname + '/resources/js'));
|
app.use('/js', express.static(__dirname + '/resources/js'));
|
||||||
app.use('/other', express.static(__dirname + '/resources/other'));
|
app.use('/other', express.static(__dirname + '/resources/other'));
|
||||||
|
|
||||||
app.get('/', auth.is, function (req, res) {
|
app.get('/', auth.is, function (req, res) {
|
||||||
req.links = config().links;
|
|
||||||
res.render('homepage', req);
|
res.render('homepage', req);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -40,16 +43,12 @@ app.param('api', api);
|
||||||
app.param('search', lookup.get);
|
app.param('search', lookup.get);
|
||||||
|
|
||||||
app.get('/rooster/:search', [auth.is, schedule.get, function (req, res) {
|
app.get('/rooster/:search', [auth.is, schedule.get, function (req, res) {
|
||||||
req.links = config().links;
|
|
||||||
req.times = config().hour_times;
|
|
||||||
res.render('schedule', req);
|
res.render('schedule', req);
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
app.param('list', lookup.list);
|
app.param('list', lookup.list);
|
||||||
|
|
||||||
app.get('/klassenlijst/:list',[auth.is, function (req, res) {
|
app.get('/klassenlijst/:list',[auth.is, function (req, res) {
|
||||||
req.links = config().links;
|
|
||||||
req.times = config().hour_times;
|
|
||||||
res.render('multiple_found', req);
|
res.render('multiple_found', req);
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue