read contribution calendar from github api

This commit is contained in:
platane
2023-07-17 19:59:59 +02:00
committed by Platane
parent 4489504b7a
commit ebeb59fced
15 changed files with 130 additions and 2689 deletions

View File

@@ -7,7 +7,11 @@ export default async (req: VercelRequest, res: VercelResponse) => {
try {
res.setHeader("Access-Control-Allow-Origin", "https://platane.github.io");
res.statusCode = 200;
res.json(await getGithubUserContribution(userName as string));
res.json(
await getGithubUserContribution(userName as string, {
githubToken: process.env.GITHUB!,
})
);
} catch (err) {
console.error(err);
res.statusCode = 500;