feat: first draft

This commit is contained in:
2025-01-25 20:39:55 +01:00
parent 78c69dbc1a
commit 06fbbab24d
53 changed files with 13416 additions and 123 deletions

15
app/api/backup/route.ts Normal file
View File

@@ -0,0 +1,15 @@
import { redis } from '@utils/redis';
import { NextResponse } from 'next/server';
import crypto from 'crypto';
export async function POST(req: Request) {
try {
const { state } = await req.json();
const key = crypto.randomBytes(8).toString('hex');
await redis.set(key, JSON.stringify(state));
return NextResponse.json({ success: true, key });
} catch (error) {
console.error(error);
return NextResponse.json({ error: 'Backup failed' }, { status: 500 });
}
}