opc meldunge parameter fehler io
This commit is contained in:
1 parent
58338ee07c
commit
0e7b53e558
87 files changed
+1500
-8
No files matched your search
@@ -0,0 +1,10 @@
|
||||
export async function GET(request: Request) {
|
||||
const params = new URL(request.url).searchParams;
|
||||
const id = params.get('id'), anlageId = params.get('anlageId');
|
||||
if (!id || !anlageId) return new Response('Verbindung fehlt', { status: 400 });
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/opcua/' + encodeURIComponent(id) + '/certificate?anlageId=' + encodeURIComponent(anlageId), { cache: 'no-store' });
|
||||
if (!response.ok) return new Response('Zertifikat konnte nicht geladen werden. Anlage und Verbindung pruefen.', { status: response.status });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'application/x-pem-file', 'Content-Disposition': 'attachment; filename="RK-OpcUaClient.pem"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Backend nicht erreichbar', { status: 502 }); }
|
||||
}
|
||||
Reference in new issue
Block a user