Spaces:
Paused
Paused
Download app/api/clear-vite-errors-cache/route.ts from Leon4gr45/paper2code-cli: direct link, hf CLI and curl.
- Browser
- Download file 614 Bytes
-
https://huggingface.co/spaces/Leon4gr45/paper2code-cli/resolve/main/app/api/clear-vite-errors-cache/route.ts
- Command line
-
hf download hf://spaces/Leon4gr45/paper2code-cli/app/api/clear-vite-errors-cache/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/Leon4gr45/paper2code-cli/resolve/main/app/api/clear-vite-errors-cache/route.ts
614 Bytes
| import { NextResponse } from 'next/server'; | |
| declare global { | |
| var viteErrorsCache: { errors: any[], timestamp: number } | null; | |
| } | |
| export async function POST() { | |
| try { | |
| // Clear the cache | |
| global.viteErrorsCache = null; | |
| console.log('[clear-vite-errors-cache] Cache cleared'); | |
| return NextResponse.json({ | |
| success: true, | |
| message: 'Vite errors cache cleared' | |
| }); | |
| } catch (error) { | |
| console.error('[clear-vite-errors-cache] Error:', error); | |
| return NextResponse.json({ | |
| success: false, | |
| error: (error as Error).message | |
| }, { status: 500 }); | |
| } | |
| } |