Skip to content

Commit 886af40

Browse files
committed
clean up
1 parent bbf504b commit 886af40

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

client/index.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ async function addSHA(sha) {
109109
return response.json()
110110
}
111111

112-
//Find Count
113-
async function findCount(sha) {
114-
const response = await fetch("http://localhost:4000/get-count/"+sha, {
115-
headers: {'Content-Type': 'application/json'},
116-
method: 'GET'
117-
})
118-
return response.json()
119-
}
120-
121112
// init req
122113
async function nowFetch() {
123114
const response = await fetch("https://mycookie-monster.herokuapp.com/", {
@@ -169,11 +160,6 @@ nowFetch().then(response => {
169160
const HASH = sha1(encodedDynamic)
170161
addSHA(HASH).then(shaRESPONSE => {
171162
console.log(shaRESPONSE)
172-
findCount(HASH).then(countRes => {
173-
console.log(countRes)
174-
}).catch(e => {
175-
console.log(e)
176-
})
177163
}).catch(e => {
178164
console.log(e)
179165
})

index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ app.get('/add-sha/:sha', (req, res) => {
9898
sha: contentSHA,
9999
content: newVisit
100100
}, {headers: { 'Authorization': "token " + KEY } }).then(done => {
101-
console.log(done.data)
102101
res.json({ visits: Base64.decode(newVisit) })
103102
})
104103
.catch(e => console.log(e))
@@ -107,17 +106,6 @@ app.get('/add-sha/:sha', (req, res) => {
107106
})
108107
})
109108

110-
app.get("/get-count/:sha", async (req, res) => {
111-
const sha = req.params.sha
112-
await Axios.get("https://api.github.com/repos/ujjwal-kr-data/ip-data/contents/"+sha, {
113-
headers: {'Authorization': "token "+KEY}
114-
}).then(res => {
115-
console.log(Base64.decode(res.data.content))
116-
}).catch(e => {
117-
res.status(400).json({message: "ERRRR"})
118-
})
119-
})
120-
121109
const port = process.env.PORT || 4000;
122110
app.listen(port, () => {
123111
console.log(`Waiting on port for someone :) ${port}`);

0 commit comments

Comments
 (0)