Quantumbraid's picture
download
raw
941 Bytes
import { NextResponse } from 'next/server';
export async function GET() {
const appUrl = process.env.OSTRIS_CLOUD_APP_URL;
const apiKey = process.env.OSTRIS_CLOUD_API_KEY;
if (!appUrl || !apiKey) {
return NextResponse.json({ enabled: false });
}
try {
const res = await fetch(`${appUrl}/api/machine/me`, {
headers: { Authorization: `Bearer ${apiKey}` },
cache: 'no-store',
});
if (!res.ok) {
return NextResponse.json({
enabled: true,
appUrl,
error: `Ostris Cloud responded with ${res.status}`,
});
}
const data = await res.json();
return NextResponse.json({
enabled: true,
appUrl,
balance: data.balance ?? null,
});
} catch (error) {
return NextResponse.json({
enabled: true,
appUrl,
error: `Failed to fetch Ostris Cloud balance: ${error instanceof Error ? error.message : String(error)}`,
});
}
}

Xet Storage Details

Size:
941 Bytes
·
Xet hash:
b3d4a72411043ffd36b9d4d4cbc0bd427365151d931f0be19e80666f778ca20b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.