github-profile-trophy-reiyu.../index.ts
2020-08-23 20:48:50 +09:00

16 lines
504 B
TypeScript

import { ServerRequest } from "./deps.ts";
import { GithubAPIClient } from "./src/github_api_client.ts";
import { Card } from "./src/card.ts";
import "https://deno.land/x/dotenv@v0.5.0/load.ts";
const client = new GithubAPIClient();
export default async (req: ServerRequest) => {
const userInfo = await client.requestUserInfo("ryo-ma")
const cardSize = 110;
req.respond(
{
body: new Card(cardSize).render(),
headers: new Headers({ "Content-Type": "image/svg+xml" }),
},
)
};