● Zion Boggan
repos/Darwin/face/src/app/api/term/route.ts
zionboggan.com ↗
22 lines · typescript
History for this file →
1
import { NextResponse } from "next/server";
2
 
3
 
4
export const dynamic = "force-dynamic";
5
export const runtime = "nodejs";
6
 
7
export async function GET() {
8
  const token = process.env.DARWIN_TERM_TOKEN ?? "";
9
  const host = process.env.DARWIN_TERM_HOST ?? "REDACTED-IP:9894";
10
 
11
  if (!token) {
12
    return NextResponse.json(
13
      { ok: false, error: "DARWIN_TERM_TOKEN not set on the server" },
14
      { status: 503 }
15
    );
16
  }
17
 
18
  return NextResponse.json(
19
    { ok: true, token, host },
20
    { headers: { "cache-control": "no-store" } }
21
  );
22
}