Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove environment variables workaround #187

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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