f5cbcdf4d1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNQ8ghPfzAfsyVYd6HgFb6
13 lines
496 B
TypeScript
13 lines
496 B
TypeScript
import type { APIRoute } from 'astro';
|
|
import { loadNasConfig, testNas } from '../../../lib/nas';
|
|
|
|
export const prerender = false;
|
|
const json = (b: unknown, s = 200) =>
|
|
new Response(JSON.stringify(b), { status: s, headers: { 'Content-Type': 'application/json' } });
|
|
|
|
export const POST: APIRoute = async () => {
|
|
const cfg = await loadNasConfig();
|
|
if (!cfg) return json({ ok: false, message: 'NAS nicht vollständig konfiguriert (oder deaktiviert).' });
|
|
return json(await testNas(cfg));
|
|
};
|