Skip to content

Commit

Permalink
add status list proxy call
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Sep 7, 2024
1 parent 875f74e commit 7ed3bda
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,23 @@ export async function build(opts = {}) {
}
})

app.get('/status/:statusCredentialId', async function (req, res, next) {
if (!enableStatusService) next({ code: 405, message: 'The status service has not been enabled.' })
const statusCredentialId = req.params.statusCredentialId
try {
const { data: statusCredential } = await axios.get(`http://${statusService}/${statusCredentialId}`)
return res.status(200).json(statusCredential)
} catch (error) {
if (error.response.status === 404) {
next({ code: 404, message: 'No status credential found for that id.' })
} else {
next(error)
}
}
return res.status(500).send({ message: 'Server error.' })
})


app.get('/seedgen', async (req, res, next) => {
const response = await axios.get(`http://${signingService}/seedgen`)
return res.json(response.data)
Expand Down

0 comments on commit 7ed3bda

Please sign in to comment.