umstellung auf claud
This commit is contained in:
1 parent
79c5f0c5cd
commit
5bb4e063da
171 files changed
+5471
-1333
No files matched your search
@@ -1,8 +1,23 @@
|
||||
import { BACKEND_URL } from '@/_config/backend';
|
||||
|
||||
const EXCEL_CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/rk2/sensoren-analog/export', { cache: 'no-store' });
|
||||
if (!response.ok) return new Response('Sensoren-Export fehlgeschlagen', { status: 502 });
|
||||
return new Response(response.body, { headers: { 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'Content-Disposition': 'attachment; filename="Sensoren_Analog.xlsx"', 'Cache-Control': 'no-store' } });
|
||||
} catch { return new Response('Keine Verbindung zum Backend', { status: 502 }); }
|
||||
try {
|
||||
const response = await fetch(`${BACKEND_URL}/rk2/sensoren-analog/export`, { cache: 'no-store' });
|
||||
|
||||
if (!response.ok) {
|
||||
return new Response('Sensoren-Export fehlgeschlagen', { status: 502 });
|
||||
}
|
||||
|
||||
return new Response(response.body, {
|
||||
headers: {
|
||||
'Content-Type': EXCEL_CONTENT_TYPE,
|
||||
'Content-Disposition': 'attachment; filename="Sensoren_Analog.xlsx"',
|
||||
'Cache-Control': 'no-store',
|
||||
},
|
||||
});
|
||||
} catch {
|
||||
return new Response('Keine Verbindung zum Backend', { status: 502 });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user