Skip to content

Commit

Permalink
Load env vars from import.meta.env
Browse files Browse the repository at this point in the history
Now that withastro/astro#2903 has been fixed,
we can remove the workaround of loading from process.env
  • Loading branch information
georgeblahblah committed Jul 6, 2022
1 parent c08590f commit 6097b1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/BlogFeed.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { timeAgo } from "@guardian/libs";
// workaround for buggy import.meta in SSR build (https://github.com/withastro/astro/issues/2903)
const CAPI_KEY = import.meta.env.CAPI_KEY ?? process.env.CAPI_KEY;
const CAPI_KEY = import.meta.env.CAPI_KEY ?? "test";
type SeriesResult = {
id: string;
Expand All @@ -23,7 +23,7 @@ type SeriesResult = {
const queryParams = new URLSearchParams({
tag: "info/series/engineering-blog",
"show-fields": "byline",
"api-key": CAPI_KEY ?? "test",
"api-key": CAPI_KEY,
});
const posts: SeriesResult[] = await fetch(
Expand Down

0 comments on commit 6097b1f

Please sign in to comment.