2015-05-19 11:03:53 +02:00
|
|
|
var pg = require('pg');
|
|
|
|
var secret = require('../../private');
|
|
|
|
|
|
|
|
module.exports.index = function(req, res) {
|
|
|
|
|
|
|
|
pg.connect(secret.url, function(err, client, release) {
|
|
|
|
client.query(
|
2015-06-04 16:52:58 +02:00
|
|
|
"INSERT INTO arrowclicked(exp_id, arrow_id, time) VALUES($1,$2, to_timestamp($3));",
|
|
|
|
[req.session.exp_id, req.body.arrow_id, req.body.time],
|
2015-05-19 11:03:53 +02:00
|
|
|
function(err, result) {
|
|
|
|
release();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
res.setHeader('Content-Type', 'text/html');
|
2015-06-05 14:51:46 +02:00
|
|
|
res.send("");
|
2015-05-19 11:03:53 +02:00
|
|
|
}
|