Skip to content

Commit

Permalink
Add openshift support
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Aug 20, 2015
1 parent b4e732f commit c60aac7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions bin/slackin
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 7,8 @@ var slackin = require('../node');
program
.version(pkg.version)
.usage('[options] <slack-subdomain> <api-token>')
.option('-p, --port <port>', 'Port to listen on [$PORT or 3000]', process.env.PORT || 3000)
.option('-p, --port <port>', 'Port to listen on [$PORT or 3000]', require('hostenv').PORT || 3000)
.option('-h, --hostname <hostname>', 'Hostname to listen on [$HOSTNAME or 0.0.0.0]', require('hostenv').HOSTNAME || '0.0.0.0')
.option('-c, --channels [<chan>]', 'One or more comma-separated channel names to allow single-channel guests [$SLACK_CHANNELS]', process.env.SLACK_CHANNELS)
.option('-c, --channel <chan>', 'Single channel guest invite (deprecated) [$SLACK_CHANNEL]', process.env.SLACK_CHANNEL)
.option('-i, --interval <int>', 'How frequently (ms) to poll Slack [$SLACK_INTERVAL or 1000]', process.env.SLACK_INTERVAL || 1000)
Expand All @@ -28,7 29,8 @@ if (!program.channels && program.channel) {
}

var port = program.port;
slackin(program).listen(port, function(err){
var hostname = program.hostname;
slackin(program).listen(port, hostname, function(err){
if (err) throw err;
if (!program.silent) console.log('%s – listening on *:%d', new Date, port);
if (!program.silent) console.log('%s – listening on %s:%d', new Date, hostname, port);
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 9,7 @@
"debug": "2.1.1",
"email-regex": "1.0.0",
"express": "4.11.0",
"hostenv": "^1.0.1",
"opentype.js": "0.4.4",
"socket.io": "1.3.5",
"superagent": "0.21.0",
Expand All @@ -25,6 26,7 @@
},
"scripts": {
"test": "mocha",
"postinstall": "make"
"postinstall": "make",
"start": "./bin/slackin"
}
}

0 comments on commit c60aac7

Please sign in to comment.