mirror of
https://github.com/joeseesun/wechat-radar.git
synced 2026-09-09 23:18:29 +09:00
Initial open source release
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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 });
|
||||
}
|
||||
Reference in New Issue
Block a user