mirror of
https://github.com/joeseesun/wechat-radar.git
synced 2026-09-08 07:38:30 +09:00
13 lines
412 B
TypeScript
13 lines
412 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
import { listTopics } from '@/lib/topics';
|
|
import { todayStr } from '@/lib/range';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export async function GET(req: NextRequest) {
|
|
const url = new URL(req.url);
|
|
const date = url.searchParams.get('date') ?? todayStr();
|
|
const topics = listTopics(date);
|
|
return NextResponse.json({ ok: true, date, topics });
|
|
}
|