aboutsummaryrefslogtreecommitdiff
path: root/api/github.js
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-03-15 12:21:38 -0400
committerBobby <[email protected]>2022-03-15 12:21:38 -0400
commitc3bdbb343462ddbba3da04d815158a9a36c09c1c (patch)
tree8b8f9d00c5462adeebc8f066721a88de9db5d745 /api/github.js
parentc9a13b8c5cd4aeca96b62532d530d2c10083788f (diff)
downloadluciferreeves.github.io-c3bdbb343462ddbba3da04d815158a9a36c09c1c.tar.xz
luciferreeves.github.io-c3bdbb343462ddbba3da04d815158a9a36c09c1c.zip
repositories page and api
Diffstat (limited to 'api/github.js')
-rw-r--r--api/github.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/api/github.js b/api/github.js
new file mode 100644
index 0000000..d08663f
--- /dev/null
+++ b/api/github.js
@@ -0,0 +1,21 @@
+const { Octokit } = require("@octokit/rest");
+class Github {
+ octokit = null;
+ username = null;
+ constructor(username) {
+ this.octokit = new Octokit();
+ this.username = username;
+ }
+ async getRepos(page) {
+ const { data } = await this.octokit.repos.listForUser({
+ username: this.username,
+ type: "all",
+ sort: "updated",
+ per_page: 25,
+ page: page
+ });
+ return data;
+ }
+}
+
+exports.Github = Github;