Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted connection setup into own method, made sure that httpOnly i…
…s given as boolean
- Loading branch information
1 parent
1e0be5c
commit 81d7ae7
Showing
5 changed files
with
32 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use strict' | ||
|
||
module.exports = function (token) { | ||
var GitHubApi = require('github') | ||
var github = new GitHubApi({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict' | ||
|
||
module.exports = function (options) { | ||
if (options.httpOnly) { | ||
return { | ||
port: options.http || 80 | ||
} | ||
} | ||
var createServer = require('auto-sni') | ||
return { | ||
listener: createServer({ | ||
// we need SSL for the webhook but the access is just-fine™ via http | ||
forceSSL: false, | ||
email: options.email, | ||
agreeTos: options.agreeTos, | ||
ports: { | ||
http: options.http, | ||
https: options.https | ||
} | ||
}), | ||
autoListen: false, | ||
tls: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
'use strict' | ||
|
||
var Path = require('path') | ||
|
||
function registerHapiPlugin (server, options, next) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters