blob: b48fac1930596f796a97d2f66ce46f2e2a50bd76 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
---
const { SSR, DB_PASSWORD, PUBLIC_SOME_KEY } = import.meta.env;
// DB_PASSWORD is available because we're running on the server
console.log({ SSR, DB_PASSWORD });
// PUBLIC_SOME_KEY is available everywhere
console.log({ SSR, PUBLIC_SOME_KEY });
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Astro</title>
</head>
<body>
<h1>Hello, Environment Variables!</h1>
<script src="/src/scripts/client.ts"></script>
</body>
</html>
|