Skip to content

Commit

Permalink
example: example app using a single node cluster manual setup
Browse files Browse the repository at this point in the history
  • Loading branch information
esatterwhite committed Feb 22, 2018
1 parent ebfaae6 commit a213c9d
Show file tree
Hide file tree
Showing 4 changed files with 2,082 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/manual-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Manual Configuration

Example single node cluster via manual server configuration

```bash
$ gnats -D -V
```

```bash
$ node index.js
```
30 changes: 30 additions & 0 deletions examples/manual-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

const Skyring = require('skyring')

const server = new Skyring({
seeds: ['127.0.0.1:3456']
, node: {
port: 3456
, host: '127.0.0.1'
, app: 'manual'
}
, nats: {
hosts: ['nats://localhost:4222']
}
, storage: {
backend: 'memdown'
}
})

server.load().listen(3000, (err) => {
console.log('server listening http://0.0.0.0:3000')
})

function onSignal() {
server.close(()=>{
console.log('shutting down');
});
}
process.once('SIGINT', onSignal);
process.once('SIGTERM', onSignal);
Loading

0 comments on commit a213c9d

Please sign in to comment.