Corrected bug
This commit is contained in:
parent
0321b70eb9
commit
a8ce19e8c3
13
server.js
13
server.js
|
@ -10,7 +10,6 @@ var app = express();
|
|||
var bodyParser = require('body-parser')
|
||||
var urls = require('./urls');
|
||||
|
||||
|
||||
app.set('view engine', 'jade');
|
||||
|
||||
app.use(bodyParser.text());
|
||||
|
@ -33,10 +32,14 @@ app.post('/post', function(req, res) {
|
|||
var user_id = req.body.user_id;
|
||||
var arrow_id = req.body.arrow_id;
|
||||
|
||||
pg.connect(pgc.url, function(err, client, done) {
|
||||
client.query("INSERT INTO arrowclicked(user_id, arrow_id) VALUES($1,$2);", [user_id, arrow_id], function(err, result) {
|
||||
// console.log(err);
|
||||
});
|
||||
pg.connect(pgc.url, function(err, client, release) {
|
||||
client.query(
|
||||
"INSERT INTO arrowclicked(user_id, arrow_id) VALUES($1,$2);",
|
||||
[user_id, arrow_id],
|
||||
function(err, result) {
|
||||
release();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
|
|
Loading…
Reference in New Issue