-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* github locked down fetching raw content from web browers so we need to go thru the server * woops
- Loading branch information
Showing
5 changed files
with
514 additions
and
32 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
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,16 @@ | ||
export const revalidate = 60 * 2; | ||
|
||
const URL_BASE = 'https://raw.githubusercontent.com/celo-org/governance/main/CGPs/cgp-'; | ||
|
||
export async function GET(request: Request, { params }: { params: Promise<{ id: string }> }) { | ||
const { id } = await params; | ||
const url = URL_BASE + zeroPad(id) + '.md'; | ||
console.info('Fetching markdown for proposal', url); | ||
const data = await fetch(url); | ||
const yaml = await data.text(); | ||
return Response.json({ yaml }); | ||
} | ||
|
||
function zeroPad(cgpDashid: string) { | ||
return cgpDashid.padStart(4, '0'); | ||
} |
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
Oops, something went wrong.