title: Where to import pool.js file in my project file structure
body: <p>I am currently working on my e-commerce project in node js, here is my project file structure-</p>
  <pre><code>public
      - assets
        - js/
        - css/
        - images/
  views
      - index.ejs
      - login.ejs
  config/
      - pool.js
  router/
      - login.js
      - index.js
      - signup.js
  app.js
  .env   
  
  Here is the code for the **pool.js** file:
  
  ```   
       require('dotenv').config();
       const mysql = require('mysql')
       
       // pool  connection 
       const pool = mysql.createPool({
               host     : process.env.DB_HOST,
               user     : process.env.DB_USER,
               password : process.env.DB_PASS,
               database : process.env.DB_NAME
       })
      
       pool.on('enqueue', (connection)=&gt;{
              console.log('Enqueue Event Triggred')
       })
       pool.on('acquire', (connection)=&gt;{
              console.log('connection acquired with threatId: ' + connection.threadId)
       })
       module.exports = pool;
  ```
  </code></pre>
  <p>and here is my router/login.js file:</p>
  <pre><code>    const express = require('express')
      const router = express.Router()
      const pool = require('../config/pool')
      const bodyParser = require('body-parser') 
      const urlencodedParser = bodyParser.urlencoded({ extended: true })
  
  router.post('/', urlencodedParser, (req, res, next)=&gt;{
      pool.getConnection(...)
  })
  
  </code></pre>
  <p>My main question is where to import the <strong>pool.js</strong> file that can be accessible to the all routers file. And what if my code for the pool.js file is replaced by the <em><strong>pool cluster connection code</strong></em>, any error??</p>