import { Pool } from "pg"; const pool = new Pool(); export const getAllUsers = async (req, res) => { try { const result = await pool.query("SELECT id, username FROM users"); res.json(result.rows); } catch (error) { console.error(error); res.status(500).json({ message: "Error fetching users" }); } };