File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { NextRequest , NextResponse } from 'next/server' ;
2+ import { getCacheStats , clearInMemoryCache } from '@/lib/cache' ;
3+ export async function GET ( request : NextRequest ) {
4+ const { searchParams } = new URL ( request . url ) ;
5+ const action = searchParams . get ( 'action' ) ;
6+
7+ try {
8+ switch ( action ) {
9+ case 'stats' :
10+ const stats = getCacheStats ( ) ;
11+ return NextResponse . json ( stats ) ;
12+
13+ case 'clear' :
14+ clearInMemoryCache ( ) ;
15+ return NextResponse . json ( { message : 'In-memory cache cleared successfully' } ) ;
16+
17+ default :
18+ return NextResponse . json ( {
19+ message : 'Cache API' ,
20+ availableActions : [
21+ 'stats - Get cache statistics' ,
22+ 'clear - Clear in-memory cache' ,
23+ 'revalidate - Revalidate GitHub API cache'
24+ ]
25+ } ) ;
26+ }
27+ } catch ( error ) {
28+ console . error ( 'Cache API error:' , error ) ;
29+ return NextResponse . json (
30+ { error : 'Internal server error' } ,
31+ { status : 500 }
32+ ) ;
33+ }
34+ }
35+
36+ export async function generateStaticParams ( ) {
37+ return [ ] ;
38+ }
Original file line number Diff line number Diff line change 1+ //import { useDocsSearch } from 'fumadocs-core/search/client';
2+ //import { create } from '@orama/orama';
3+ import { NextRequest , NextResponse } from "next/server" ;
4+ //import { createFromSource } from 'fumadocs-core/search/server';
5+ //import { source } from '@/lib/source';
6+ //import { createLocalSource } from "@/lib/sources/local";
7+
8+ export async function GET ( ) {
9+ return NextResponse . json ( { message : "Search not implemented" } ) ;
10+ }
11+
12+ export async function generateStaticParams ( ) {
13+ return [ ] ;
14+ }
Original file line number Diff line number Diff line change @@ -30,3 +30,8 @@ export async function GET(request: NextRequest) {
3030 } ) ;
3131 }
3232}
33+
34+
35+ export async function generateStaticParams ( ) {
36+ return [ ] ;
37+ }
You can’t perform that action at this time.
0 commit comments