mirror of
https://github.com/withastro/astro.git
synced 2025-04-07 23:41:43 -05:00
Prefer getting app token from runtime env (#10445)
This commit is contained in:
parent
5166e9715a
commit
098623c261
2 changed files with 6 additions and 1 deletions
5
.changeset/dry-rivers-switch.md
Normal file
5
.changeset/dry-rivers-switch.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@astrojs/db": patch
|
||||
---
|
||||
|
||||
Prefer getting the app token from the runtime env
|
|
@ -142,7 +142,7 @@ export function getStudioVirtualModContents({
|
|||
return `
|
||||
import {asDrizzleTable, createRemoteDatabaseClient} from ${RUNTIME_IMPORT};
|
||||
|
||||
export const db = await createRemoteDatabaseClient(${JSON.stringify(
|
||||
export const db = await createRemoteDatabaseClient(process.env.ASTRO_STUDIO_APP_TOKEN ?? ${JSON.stringify(
|
||||
appToken
|
||||
// Respect runtime env for user overrides in SSR
|
||||
)}, import.meta.env.ASTRO_STUDIO_REMOTE_DB_URL ?? ${JSON.stringify(getRemoteDatabaseUrl())});
|
||||
|
|
Loading…
Add table
Reference in a new issue