NodeJs and Postgres-Connection terminated unexpectedly

I’m trying to connect my Node project to Postgres.
My server is running in the project.
In Postgres, when I execute a data retrieval command, it also return me the correct data.
But when he wants to retrieve data in the get method in the reposutory file in the project.
He doesn’t succeed and i have this erorr:Connection terminated unexpectedly

when i run the project i have in my console these messeges:

Database user: postgres
Database host: xxx
Database name: Dependencies_Planner
Database password: xxx
Database port: 5432
Server is running on port 3000

but ehwn i put this url in postman:http://localhost:3000/api/requestor-names
i got this erorr in postman:Internal Server Error and status :500.
and these erorrs in the console:

controller
Entering getAllProductManagerNames method
Error executing query in getAllProductManagerNames: Error: Connection terminated unexpectedly
at C:UsersUSERDesktopDPDependencies-Planner-PRDnode_modulespg-poolindex.js:45:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Error fetching requestor names: Error: Connection terminated unexpectedly
at C:UsersUSERDesktopDPDependencies-Planner-PRDnode_modulespg-poolindex.js:45:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)

I put here all the files in my project that are related to the method.
this is my .env file:

PGUSER="postgres"
PGHOST="xxx"
PGDATABASE="Dependencies_Planner"
PGPASSWORD="xxx"
PGPORT=5432
EXPRESS_PORT=3000
PGPASSWORD="Bidhsyr66333!!!"

this is my db file:

import { Pool } from 'pg';
import dotenv from 'dotenv';

dotenv.config();
console.log('Database user:', process.env.PGUSER);
console.log('Database host:', process.env.PGHOST);
console.log('Database name:', process.env.PGDATABASE);
console.log('Database password:', process.env.PGPASSWORD); 
console.log('Database port:', process.env.PGPORT);



const pool = new Pool({
  user: process.env.PGUSER,
  host: process.env.PGHOST,
  database: process.env.PGDATABASE,
 password: process.env.PGPASSWORD, 
  port: Number(process.env.PGPORT),
  
});

export default pool;

this is my repository file:

import pool from '../config/db';

export default class ProductManagerRepo {
    static async getAllProductManagerNames(): Promise<{ name: string }[]> {
        try {
            console.log('Entering getAllProductManagerNames method');
            const result = await pool.query('SELECT name FROM productmanager');
            console.log('Query executed successfully, result:', result.rows);
            return result.rows;
        } catch (err) {
            console.error('Error executing query in getAllProductManagerNames:', err);
            throw err;
        }
    }
}

this is my controller file:

import { Request, Response } from 'express';
import ProductManagerRepo from '../repositories/productManagerRepo';



export const getRequestorNames = async (req: Request, res: Response): Promise<void> => {
    console.log('controller')
    try {
      const productManagerNames = await ProductManagerRepo.getAllProductManagerNames();
      res.json(productManagerNames);
    } catch (error) {
      console.error('Error fetching requestor names:', error);
      res.status(500).send('Internal Server Error');
    }
  };

this is my model file :

export interface ProductManager{
    email:string,
    name:string,
    groupId:number
    };

this is my app file:

import express from 'express';
import dotenv from 'dotenv';
import ProductmanagerRoutes from './src/routes/productManagerRoutes'

dotenv.config();

const app = express();
const port = process.env.EXPRESS_PORT || 3000;

app.use(express.json());


app.use('/api', ProductmanagerRoutes);

app.listen(port, () => {
  console.log(`Server is running on port ${port}`);
});

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật