Files
sitemente/app/mission-control/hp-leads/page.tsx
T
horus d5575b58e3 SiteMente - AI-Powered Lead Generation Platform
Features:
- Mission Control dashboard
- HP Submissions tracking
- AI Agents integration
- Lead management CRM
- Marketing email templates
- Chrome extension support

Tech: Next.js, TypeScript, Tailwind CSS, MySQL
2026-03-19 17:38:12 +01:00

28 lines
734 B
TypeScript

import { NextResponse } from 'next/server'
import mysql from 'mysql2/promise'
export const dynamic = 'force-dynamic'
async function getPool() {
return mysql.createPool({
host: 'localhost',
user: 'sitemente',
password: 'pa0ndoQRPDYBHzTXX3rbWd6E',
database: 'sitemente',
waitForConnections: true,
connectionLimit: 10
})
}
export async function GET() {
try {
const pool = await getPool()
const [rows] = await pool.query('SELECT * FROM hostpioneers_leads ORDER BY total_spent DESC LIMIT 100')
await pool.end()
return NextResponse.json({ leads: rows })
} catch (error) {
console.error('Error:', error)
return NextResponse.json({ error: 'Failed to fetch' }, { status: 500 })
}
}