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,21 @@
var pg = require('pg');
var secret = require('../../private');
var Log = require('../../lib/NodeLog.js');
module.exports.index = function(req, res) {
pg.connect(secret.url, function(err, client, release) {
client.query(
"INSERT INTO coinclicked(exp_id, coin_id, time) VALUES($1,$2, to_timestamp($3));",
[req.session.expId, req.body.coinId, req.body.time],
function(err, result) {
if (err !== null)
Log.dberror(err + ' in coin-clicked');
release();
}
);
});
res.setHeader('Content-Type', 'text/html');
res.send("");
};

View File

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