Open History to see the last commit
1import { createFileRoute } from '@tanstack/react-router'
2
3/**
4 * Reports whether the *server* process is running under Bun.
5 * The browser cannot see this — `typeof Bun` is only meaningful in the
6 * process that creates isolate drivers — so the Isolate VM sidebar fetches
7 * this endpoint to warn when "QuickJS Bun" would fall back to WASM.
8 */
9export const Route = createFileRoute('/api/runtime')({
10 server: {
11 handlers: {
12 GET: async () => {
13 const isBun =
14 typeof (globalThis as { Bun?: unknown }).Bun !== 'undefined'
15 return Response.json({
16 isBun,
17 runtime: isBun ? 'bun' : 'node',
18 })
19 },
20 },
21 },
22})