Skip to content

Commit

Permalink
#144 update status response (test redeploy)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiloCK committed Nov 27, 2021
1 parent cf26355 commit 9a9b1c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/express/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,21 @@ app.post('/', (req, res) => {
});

app.get('/', (req, res) => {
let status = 'Express service is running.\n';

CouchDB.session()
.then((s) => {
if (s.ok) {
res.send(`Couchdb session is active. (this message is from express...)`);
status += 'Couchdb is running.\n';
} else {
res.send(`Couchdb session is ... not ok?`);
status += 'Couchdb session is NOT ok.\n';
}
})
.catch((e) => {
res.send(`Problems in the couch session! ${JSON.stringify(e)}`);
status += `Problems in the couch session! ${JSON.stringify(e)}`;
})
.finally(() => {
res.send(status);
});
});

Expand Down

0 comments on commit 9a9b1c4

Please sign in to comment.