🚀 add service with vercel
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { getGithubUserContribution } from "@snk/github-user-contribution";
|
||||
import { NowRequest, NowResponse } from "@vercel/node";
|
||||
|
||||
export default async (req: NowRequest, res: NowResponse) => {
|
||||
const { userName } = req.query;
|
||||
|
||||
try {
|
||||
res.json(await getGithubUserContribution(userName as string));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
res.statusCode = 500;
|
||||
res.end();
|
||||
}
|
||||
};
|
||||
7
packages/github-user-contribution-service/package.json
Normal file
7
packages/github-user-contribution-service/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "@snk/github-user-contribution-service",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@vercel/node": "1.8.4"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user