import Pool from '@/lib/db';
import { NextResponse } from 'next/server';
import {pool} from '@/lib/database';

export async function GET(req)  {
  console.log(req)
    try {
      const rows = await pool('SELECT * FROM product')
      console.log(rows)
      return NextResponse.json(rows);
      
    } catch (err) {
      console.error(err);
      //res.status(500).json({ error: 'Failed to fetch cases' });
      return NextResponse.json({err:err.mesage})
    }
  }

