Some cleaning 😢

This commit is contained in:
Thomas FORGIONE
2015-11-13 10:36:54 +01:00
parent 59518eb702
commit 5e0a6c3121
113 changed files with 433 additions and 67 deletions

View File

@@ -0,0 +1,39 @@
var db = require('../prototype/dbrequests.js');
var vcode = require('../../lib/vcode.js');
module.exports.index = function(req, res) {
// If not micro-worker
if (req.session.workerId === undefined) {
res.setHeader('Content-Type', 'text/html');
res.send(null);
return;
}
// Else, check that exp was correctly done
db.getUser(req.session.userId, function(workerId, ok) {
res.setHeader('Content-Type', 'text/html');
if (ok === true) {
var code = vcode(req.session.workerId);
res.send(code);
} else if (ok === false) {
res.send('no vcode');
} else {
res.send('not ready');
}
});
};

View File

@@ -0,0 +1,3 @@
module.exports = {
'/vcode': 'index',
};