diff --git a/.dockerignore b/.dockerignore index 28fda52..f2651f8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,5 @@ **/*.env -node_modules \ No newline at end of file +node_modules +compose-health-test.yaml +compose-v2-test.yaml +.env.healthcheck.testing \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8078a01..93c629f 100644 --- a/.gitignore +++ b/.gitignore @@ -108,4 +108,8 @@ dist .tern-port # vscode -.vscode \ No newline at end of file +.vscode + +compose-health-test.yaml +compose-v2-test.yaml +.env.healthcheck.testing \ No newline at end of file diff --git a/src/app.js b/src/app.js index 2dd1f6e..d99323e 100644 --- a/src/app.js +++ b/src/app.js @@ -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)