mirror of
https://github.com/xmanrui/OpenClaw-bot-review.git
synced 2026-07-27 22:25:52 +00:00
17 lines
466 B
TypeScript
17 lines
466 B
TypeScript
import { NextResponse } from 'next/server'
|
|
import fs from 'fs'
|
|
import path from 'path'
|
|
|
|
export async function GET() {
|
|
const dir = path.join(process.cwd(), 'public', 'assets', 'pixel-office')
|
|
try {
|
|
const files = fs.readdirSync(dir)
|
|
const tracks = files
|
|
.filter(f => f.toLowerCase().endsWith('.mp3'))
|
|
.map(f => `/assets/pixel-office/${f}`)
|
|
return NextResponse.json({ tracks })
|
|
} catch {
|
|
return NextResponse.json({ tracks: [] })
|
|
}
|
|
}
|