mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-21 14:58:58 +00:00
new examples
This commit is contained in:
31
node/astro/static/src/pages/index.astro
Normal file
31
node/astro/static/src/pages/index.astro
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
// 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>
|
||||
Reference in New Issue
Block a user