From bb7d4af59eafa8b80f3443c70691241cd434c5a9 Mon Sep 17 00:00:00 2001 From: Isuru Edirisinghe Date: Wed, 16 Oct 2019 11:06:14 +0530 Subject: [PATCH] added json formatting or result --- back-end/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/back-end/index.js b/back-end/index.js index 4f9f65b..6021a70 100644 --- a/back-end/index.js +++ b/back-end/index.js @@ -7,7 +7,7 @@ require('dotenv').config(); const port = process.env.PORT; const octokit = new Octokit({ auth: process.env.SECRET }); -var dataSet; +var dataSet={}; app.get('/', async (req, res) => { @@ -24,7 +24,7 @@ app.get('/', async (req, res) => { repo: repoName }); - let fetchedContributors = ["aa"]; + let fetchedContributors = [repoName]; result.data.map(contributor => { if (fetchedContributors.length != 0) { @@ -36,7 +36,8 @@ app.get('/', async (req, res) => { } }); - console.log(fetchedContributors); + + dataSet[repoName]=fetchedContributors; }); res.send("

" + dataSet + "

");