diff --git a/src/github/github.controller.ts b/src/github/github.controller.ts index c714ae6..4c2d658 100644 --- a/src/github/github.controller.ts +++ b/src/github/github.controller.ts @@ -10,26 +10,30 @@ export class GithubController { gh_token = process.env.GITHUB_TOKEN; @Get() - getOrganizationInfo() { + async getOrganizationInfo() { const octokit = new Octokit({ auth: this.gh_token }); - return octokit.request('GET /orgs/poapper'); + const res = await octokit.request('GET /orgs/poapper'); + return res.data; } @Get('member') - getGithubMembers() { + async getGithubMembers() { const octokit = new Octokit({ auth: this.gh_token }); - return octokit.request('GET /orgs/poapper/public_members'); + const res = await octokit.request('GET /orgs/poapper/public_members'); + return res.data; } @Get('repo') - getGithubRepositories() { + async getGithubRepositories() { const octokit = new Octokit({ auth: this.gh_token }); - return octokit.request('GET /orgs/poapper/repos'); + const res = await octokit.request('GET /orgs/poapper/repos'); + return res.data; } @Get('event') - getGithubEvent() { + async getGithubEvent() { const octokit = new Octokit({ auth: this.gh_token }); - return octokit.request('GET /orgs/poapper/events?per_page=10'); + const res = await octokit.request('GET /orgs/poapper/events?per_page=10'); + return res.data; } } diff --git a/src/main.ts b/src/main.ts index 3f36ab9..b6cb1a8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,7 +8,13 @@ async function bootstrap() { app.use(cookieParser()); app.enableCors({ - origin: ['http://localhost:8000'], + origin: [ + 'http://localhost:8000', + 'http://localhost:9000', + 'http://localhost:9001', + 'https://poapper.club', + 'https://dev.poapper.club', + ], credentials: true, });