There is a small application for node-express, PSQL base, EJS acts as a template engine. At index.ejs there is a search form, the question arose how to pass a variable from a form to a psql request.

The request itself looks like this, you need to transfer the value of inputa to "subscriber"

pool.connect(function (err, client, done) { if (err) { console.log("Can not connect to the DB" + err); } client.query('SELECT * FROM cdr_final WHERE info_init @> \'{"subscriber":"99999999"}\' ORDER BY id DESC LIMIT 20', function (err, result) { done(); if (err) { console.log(err); res.status(400).send(err); } 

    0