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,30 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
// Try multiple possible paths
|
||||
const possiblePaths = [
|
||||
path.join(process.cwd(), '..', 'hostpioneers.com', 'public_html', 'contacts.json'),
|
||||
path.join(process.cwd(), 'public', '..', 'contacts.json'),
|
||||
'/var/www/hostpioneers.com/public_html/contacts.json',
|
||||
]
|
||||
|
||||
let data = '[]'
|
||||
for (const filePath of possiblePaths) {
|
||||
if (fs.existsSync(filePath)) {
|
||||
data = fs.readFileSync(filePath, 'utf-8')
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const submissions = JSON.parse(data || '[]')
|
||||
return NextResponse.json({ submissions: submissions.reverse() })
|
||||
} catch (error) {
|
||||
console.error('Error:', error)
|
||||
return NextResponse.json({ submissions: [], error: 'Failed to fetch' }, { status: 200 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user