Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ http://primo.lib.umn.edu/primo_library/libweb/action/dlSearch.do?institution=TWI
- [Sessions](#sessions)
- [Logging](#logging)
- [redirectLogEvent(ctx)](#redirectlogeventctx)
- [Health Check URI](#health-check-uri)
- [Install](#install)
- [Test](#test)
- [Lint](#lint)
Expand Down Expand Up @@ -220,7 +221,7 @@ Janus uses [koa-session](https://www.npmjs.com/package/koa-session) to assign ea

One way to override this method when invoking Janus:

```javascript
```javascript
const plugins = require('your-plugins');
const janus = require('@nihiliad/janus').methods({
sessionId (ctx) {
Expand All @@ -229,7 +230,7 @@ const janus = require('@nihiliad/janus').methods({
// generate your session id
);
});
},
},
});
const app = janus({
uriFactoryPlugins: plugins,
Expand Down Expand Up @@ -264,6 +265,15 @@ const app = janus({
app.listen(3000);
```

## Health Check URI
The application will return a basic `200 ok` at a URI under `uriPathPrefix`, e.g.
```
// uriPathPrefix = '/janus'

GET /janus/healthcheck
200 ok
```

## Install

Install with npm. In package.json, include something like...
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ export default stampit()
}
})

// Basic 200 response to validate the node app works
// No logging redirect/error
router.get(params.uriPathPrefix + '/healthcheck', function(ctx, next) {
ctx.body = 'ok'
})

const app = new Koa()
app
.use(favicon(this.favicon))
Expand Down