Skip to content

Commit

Permalink
use local functions for data retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
joehquak committed May 31, 2022
1 parent 458aa4f commit 11041f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dist/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function createCommentSVG() {
}

async function fetchRepoIssues(repo) {
const issueRes = await fetch(`https://api.github.com/repos/${repo.full_name}/issues`, {
const issueRes = await fetch(`/get/?repo=${repo.full_name}`, {
headers: {
Authorization: '',
},
Expand Down Expand Up @@ -157,7 +157,7 @@ async function loadGithubIssues() {

const issuesURL = useLocalIssues
? './repos.json'
: 'https://api.github.com/orgs/alchemistcoin/repos?sort=updated';
: '/get/';

try {
const res = await fetch(issuesURL, {
Expand Down
8 changes: 7 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[[plugins]]
package = '@netlify-tools/netlify-plugin-env'
package = '@netlify-tools/netlify-plugin-env'

[[redirects]]
from = "/get/*"
to = "/.netlify/functions/get-github-issues/:splat"
status = 200
force = true

0 comments on commit 11041f9

Please sign in to comment.