Skip to content

Commit

Permalink
timer: pass all storage options to levelup
Browse files Browse the repository at this point in the history
This will allow configuration of swappable storage backends
  • Loading branch information
esatterwhite committed Feb 19, 2018
1 parent 6de077c commit 2c10a0a
Show file tree
Hide file tree
Showing 7 changed files with 2,241 additions and 4 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ compose/
tutorials/
assets/
quay/
examples/
.nyc_output/
Dockerfile*
*.save
Expand Down
11 changes: 11 additions & 0 deletions examples/mongo-storage/@skyring/mongodown-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"nats": {
"hosts": ["nats://localhost:4222"]
}
, "storage": {
"backend": "mongodown"
, "path": "skyring-1"
}
, "seeds": ["127.0.01:3455"]
, "channel": { "host": "127.0.0.1", "port": 3455 }
}
Empty file.
22 changes: 22 additions & 0 deletions examples/mongo-storage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const Skyring = require('skyring')

const server = new Skyring()

server.load().listen(process.env.PORT || 3000, (err) => {
if(err) {
process.exitCode = 1;
console.error(err);
throw err;
}
console.log('server listening');
});

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

0 comments on commit 2c10a0a

Please sign in to comment.