title: Where should I initialize pg-promise
body: <p>I just started to learn <code>nodejs-postgres</code> and found the <code>pg-promise</code> package.
  I read the docs and examples but I don't understand where should I put the initialization code? I using Express and I have many routes. </p>
  
  <p>I have to put whole initialization (including <code>pg-monitor</code> init) to every single file where I would like to query the db or I need to include and <code>initalize/configure</code> them only in the server.js?</p>
  
  <p>If I initialized them only in the server.js what should I include other files where I need a db query? </p>
  
  <p>In other words. Its not clear to me if pg-promise and pg-monitor <code>configuration/initalization</code> was a global or a local action? </p>
  
  <p>It's also unclear if I need to create a db variable and end pgp for every single query?</p>
  
  <pre><code>var db = pgp(connection);
  
  db.query(...).then(...).catch(...).finally(**pgp.end**);
  </code></pre>