Initial commit — Sistema Generador de Guiones V4.0
Pipeline completo: URL → Whisper → GPT-4o → pgvector → Supabase Frontend Vue 3 + Tailwind, Backend Express + Vercel serverless functions
This commit is contained in:
15
api/nichos.js
Normal file
15
api/nichos.js
Normal file
@ -0,0 +1,15 @@
|
||||
import { supabase } from '../backend/lib/supabase.js'
|
||||
|
||||
export default async function handler(req, res) {
|
||||
if (req.method !== 'GET') return res.status(405).json({ error: 'Método no permitido' })
|
||||
|
||||
const { data, error } = await supabase
|
||||
.from('guiones')
|
||||
.select('niche')
|
||||
.eq('procesado_ok', true)
|
||||
|
||||
if (error) return res.status(500).json({ error: error.message })
|
||||
|
||||
const nichos = [...new Set(data.map(r => r.niche))].sort()
|
||||
res.json(nichos)
|
||||
}
|
||||
Reference in New Issue
Block a user