From c3bdbb343462ddbba3da04d815158a9a36c09c1c Mon Sep 17 00:00:00 2001 From: Bobby Date: Tue, 15 Mar 2022 12:21:38 -0400 Subject: repositories page and api --- api/github.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 api/github.js (limited to 'api/github.js') 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; -- cgit v1.2.3