
trungdq88/jev-tetris on GitHub
- Stars
- 14
- Forks
- 5
- Language
- JavaScript
- Last push
- 21 Sep 2026
Read from GitHub on . Counts change daily.
How it uses Jev
// Shared proxy logic: forwards one request to the TypeSafe API with the key
// the visitor supplied. Used by server.mjs (local) and api/*.js (Vercel).
export const TYPESAFE_BASE = process.env.TYPESAFE_API_BASE || "https://api.typesafe.ai";
// Optional host-provided fallback key; leave unset for a public deployment.
export const SERVER_KEY = process.env.TYPESAFE_API_KEY || "";
export const UPSTREAM_TIMEOUT_MS = 30_000;
export function keyFromAuthorization(header) {
const match = /^Bearer\s+(.+)$/i.exec((header || "").trim());
const key = match ? match[1].trim() : "";
return key || SERVER_KEY;
}
// Returns { status, headers, body } ready to be written to the client.


