🚀 github contribution service cors

This commit is contained in:
platane
2020-10-21 01:25:33 +02:00
parent 5958a006b7
commit 43cee13f25
4 changed files with 15 additions and 10 deletions

View File

@@ -5,6 +5,8 @@ export default async (req: NowRequest, res: NowResponse) => {
const { userName } = req.query;
try {
res.setHeader("Access-Control-Allow-Origin", "https://platane.github.io");
res.statusCode = 200;
res.json(await getGithubUserContribution(userName as string));
} catch (err) {
console.error(err);