mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-20 06:18:57 +00:00
32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
---
|
|
// Build-time public var (baked into bundle)
|
|
const buildPublicVar = import.meta.env.PUBLIC_BUILD_PUBLIC_VAR || 'default-value';
|
|
console.log('=== Build-time Variables ===');
|
|
console.log('PUBLIC_BUILD_PUBLIC_VAR:', buildPublicVar);
|
|
---
|
|
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
<meta name="viewport" content="width=device-width" />
|
|
<meta name="generator" content={Astro.generator} />
|
|
<title>Astro</title>
|
|
</head>
|
|
<body>
|
|
<div style="padding: 20px; background: #f0f0f0; margin: 20px; border-radius: 8px;">
|
|
<h2>Environment Variable Test</h2>
|
|
<h3>Build-time (baked into bundle)</h3>
|
|
<p><strong>PUBLIC_BUILD_PUBLIC_VAR:</strong> {buildPublicVar}</p>
|
|
<p style="color: #666; font-size: 14px;">
|
|
Note: Static sites only support build-time env vars (no server at runtime)
|
|
</p>
|
|
</div>
|
|
<h1>Astro</h1>
|
|
<script define:vars={{ buildPublicVar }}>
|
|
console.log('=== Build-time Variables ===');
|
|
console.log('PUBLIC_BUILD_PUBLIC_VAR:', buildPublicVar);
|
|
</script>
|
|
</body>
|
|
</html>
|