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
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user