feat: initial brainstorming app — Nuxt 3 + SQLite + admin auth
Nuxt 3 app with: - SQLite (better-sqlite3) for persistence - Anonymous idea submission and voting - Admin auth with session cookies - AI analysis via Gemini API - Nuxt UI components + Tailwind Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
10
server/api/ideas/index.get.ts
Normal file
10
server/api/ideas/index.get.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import db from '../../utils/db'
|
||||
import { isAdmin } from '../../utils/auth'
|
||||
|
||||
export default defineEventHandler((event) => {
|
||||
const admin = isAdmin(event)
|
||||
const rows = admin
|
||||
? db.prepare('SELECT * FROM ideas ORDER BY created_at DESC').all()
|
||||
: db.prepare('SELECT * FROM ideas WHERE hidden = 0 ORDER BY created_at DESC').all()
|
||||
return rows
|
||||
})
|
||||
Reference in New Issue
Block a user