-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ add CF function for getting SLUG.config.json (#3870)
This PR adds routing to the `/grapher/SLUG.ts` function and adds an endpoint in the form `/grapher/SLUG.config.json` that just returns the grapher config from R2. It takes redirects into account, just like the related function that rewrites the HTML to have dynamic thumbnails.
- Loading branch information
Showing
4 changed files
with
210 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export interface Env { | ||
ASSETS: { | ||
fetch: typeof fetch | ||
} | ||
url: URL | ||
GRAPHER_CONFIG_R2_BUCKET_URL: string | ||
GRAPHER_CONFIG_R2_BUCKET_FALLBACK_URL: string | ||
GRAPHER_CONFIG_R2_BUCKET_PATH: string | ||
GRAPHER_CONFIG_R2_BUCKET_FALLBACK_PATH: string | ||
CF_PAGES_BRANCH: string | ||
ENV: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters