Skip to content

Commit

Permalink
Added kue-dashboard script for conveniently running the dashboard
Browse files Browse the repository at this point in the history
as a standalone application without creating a new script.
  • Loading branch information
mikob committed May 12, 2015
1 parent dd22d06 commit 7359de1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,16 @@ var q = kue.createQueue({

## User-Interface

The UI is a small [Express](http://github.com/visionmedia/express) application, to fire it up simply run the following, altering the port etc as desired.
The UI is a small [Express](http://github.com/visionmedia/express) application.
A script is provided in `bin/` for running the interface as a standalone application
with default settings. You may pass in options for the port and redis-url. For example:

```
node_modules/kue/bin/kue-dashboard -p 3050 -r redis://127.0.0.1:3000
```

You can fire it up from within another application too:


```js
var kue = require('kue');
Expand Down
21 changes: 21 additions & 0 deletions bin/kue-dashboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node
var kue = require('kue');
var argv = require('yargs')
.usage('Usage: $0 [options]')
.example('$0 -p 3050 -r redis://10.0.0.4:6379')
.describe('r', 'Redis url')
.describe('p', 'Dashboard port')
.default('p', 3000)
.default('r', 'redis://127.0.0.1:6379')
.help('h')
.alias('h', 'help')
.argv
;

kue.createQueue({
redis: argv.r
});


kue.app.listen(argv.p);
console.log("Running on 127.0.0.1:" + argv.p);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"node-redis-warlock": "^0.1.2",
"redis": "~0.12.0",
"reds": "~0.2.5",
"stylus": "0.42.2"
"stylus": "0.42.2",
"yargs": "^3.9.0"
},
"devDependencies": {
"async": "^0.9.0",
Expand Down

0 comments on commit 7359de1

Please sign in to comment.