Open DB connection only once for all requests
<p>In my below code, I am trying to open DB connection before "/post" request. I can solve the below issue using global connection but is there any other way to do it by just binding db connection to the current request.</p>

<pre><code>//Model.js
function DB(){
    this.DBConn (req, res, next) {
        var conn = &lt;db connection string&gt;;
        pg.connect(conn, function (err, client) {
        req.db = client;
        })
    this.create (req, res, next) {
        // Using req.db.query(), to execute INSERT query
        }
    }
}
//server.js
var DB = require('./model.js');
var app = express.Router();
// Open DB connection
new DB.DBConn(); //How to pass request in this function
app.post('/post', DB.create);
</code></pre>