Update blog example env name (#5877)
This commit is contained in:
parent
1ca81c16b8
commit
2000f5fb1e
2 changed files with 10 additions and 4 deletions
|
@ -17,11 +17,9 @@ type Commit = {
|
|||
|
||||
async function getCommits(url: string) {
|
||||
try {
|
||||
const token = import.meta.env.SNOWPACK_PUBLIC_GITHUB_TOKEN ?? 'hello';
|
||||
const token = import.meta.env.GITHUB_TOKEN ?? 'hello';
|
||||
if (!token) {
|
||||
throw new Error(
|
||||
'Cannot find "SNOWPACK_PUBLIC_GITHUB_TOKEN" used for escaping rate-limiting.'
|
||||
);
|
||||
throw new Error('Cannot find "GITHUB_TOKEN" used for escaping rate-limiting.');
|
||||
}
|
||||
|
||||
const auth = `Basic ${Buffer.from(token, 'binary').toString('base64')}`;
|
||||
|
|
8
examples/docs/src/env.d.ts
vendored
8
examples/docs/src/env.d.ts
vendored
|
@ -1 +1,9 @@
|
|||
/// <reference types="astro/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly GITHUB_TOKEN: string | undefined;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue