mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-20 06:18:57 +00:00
new examples
This commit is contained in:
19
node/tanstack-start/ssr/app/routes/api/env.ts
Normal file
19
node/tanstack-start/ssr/app/routes/api/env.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { json } from '@tanstack/react-start';
|
||||
import { createAPIFileRoute } from '@tanstack/react-start/api';
|
||||
|
||||
// Runtime env vars (read at server startup)
|
||||
const RUNTIME_PRIVATE_VAR = process.env.RUNTIME_PRIVATE_VAR || 'default-value';
|
||||
const RUNTIME_PUBLIC_VAR = process.env.RUNTIME_PUBLIC_VAR || 'default-value';
|
||||
|
||||
console.log('=== Runtime Variables ===');
|
||||
console.log('RUNTIME_PRIVATE_VAR:', RUNTIME_PRIVATE_VAR);
|
||||
console.log('RUNTIME_PUBLIC_VAR:', RUNTIME_PUBLIC_VAR);
|
||||
|
||||
export const APIRoute = createAPIFileRoute('/api/env')({
|
||||
GET: () => {
|
||||
return json({
|
||||
runtimePrivateVar: RUNTIME_PRIVATE_VAR,
|
||||
runtimePublicVar: RUNTIME_PUBLIC_VAR,
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user