2015-09-29 17:22:48 +02:00
|
|
|
var db = require('../prototype/dbrequests.js');
|
|
|
|
var vcode = require('../../lib/vcode.js');
|
|
|
|
|
2015-07-29 11:04:38 +02:00
|
|
|
module.exports.index = function(req, res) {
|
2015-08-31 13:05:05 +02:00
|
|
|
|
2015-10-05 09:50:04 +02:00
|
|
|
// If not micro-worker
|
|
|
|
if (req.session.workerId === undefined) {
|
2015-09-29 17:22:48 +02:00
|
|
|
|
2015-10-05 09:50:04 +02:00
|
|
|
res.setHead('Content-Type', 'text/html');
|
2015-09-29 17:22:48 +02:00
|
|
|
|
2015-10-05 09:50:04 +02:00
|
|
|
res.render('normal.jade', res.locals, function(err, result) {
|
2015-09-29 17:22:48 +02:00
|
|
|
res.send(result);
|
|
|
|
});
|
2015-07-29 11:04:38 +02:00
|
|
|
|
2015-10-05 09:50:04 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
res.setHeader('Content-Type', 'text/html');
|
|
|
|
|
|
|
|
res.render('vcode.jade', res.locals, function(err, result) {
|
|
|
|
console.log(err);
|
|
|
|
res.send(result);
|
2015-07-29 11:04:38 +02:00
|
|
|
});
|
2015-09-29 17:22:48 +02:00
|
|
|
|
2015-07-29 11:04:38 +02:00
|
|
|
};
|
|
|
|
|