Skip to content

Commit

Permalink
add status credential GET endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Sep 4, 2024
1 parent feed0ae commit 75c8272
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
**/*.env
node_modules
node_modules
compose-health-test.yaml
compose-v2-test.yaml
.env.healthcheck.testing
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,8 @@ dist
.tern-port

# vscode
.vscode
.vscode

compose-health-test.yaml
compose-v2-test.yaml
.env.healthcheck.testing
14 changes: 14 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ export async function build (opts = {}) {
}
})

app.get('/status/:statusCredentialId', async function (req, res, next) {
const statusCredentialId = req.params.statusCredentialId
try {
const { data: statusCredential } = await axios.get(`http://${statusService}/${statusCredentialId}`)
return res.status(200).json(statusCredential)
} catch (error) {
next({
message: error.message,
code: error.code
})
}
return res.status(200).send({ message: 'status service is not configured.' })
})

// Attach the error handling middleware calls, in order they should run
app.use(errorLogger)
app.use(errorHandler)
Expand Down

0 comments on commit 75c8272

Please sign in to comment.