endpoint to get count of all bounties

This commit is contained in:
Matthias Kretschmann 2018-12-20 14:47:35 +01:00 committed by GitHub
parent 476ddcfb56
commit 4da6165842
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -49,4 +49,17 @@ server.get('/', async (req, res) => {
}
})
server.get('/all', async (req, res) => {
try {
const response = await axios.get('https://api.bounties.network/bounty/?search=ocean%20protocol')
const allBounties = response.data
const data = { count: allBounties.count }
res.send(data)
} catch (error) {
res.send(error)
}
})
module.exports = webtask.fromExpress(server)