mirror of
https://github.com/joeseesun/wechat-radar.git
synced 2026-09-08 04:38:29 +09:00
15 lines
425 B
TypeScript
15 lines
425 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { wxDaemonStatus } from '@/lib/wx';
|
|
import { cache, CK } from '@/lib/cache';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export async function GET() {
|
|
let s = cache.get(CK.daemon()) as Awaited<ReturnType<typeof wxDaemonStatus>> | undefined;
|
|
if (!s) {
|
|
s = await wxDaemonStatus();
|
|
cache.set(CK.daemon(), s, 30);
|
|
}
|
|
return NextResponse.json({ ok: true, ...s });
|
|
}
|