Comparing version 0.2.8 to 0.2.9
@@ -123,5 +123,29 @@ /** | ||
function start_app() { | ||
this.server = this.listen(this.config.port); | ||
console.log('[ ' + this.constants.name + ' ] worker listening on port ' + this.config.port); | ||
var port; | ||
if (this.config.https) { | ||
port = this.config.https.port; | ||
// setup main https server | ||
this.server = require('https').createServer({ | ||
key: fs.readFileSync(this.dir+this.config.https.key), | ||
cert: fs.readFileSync(this.dir+this.config.https.cert) | ||
}, this).listen(port); | ||
// setup forwarding http server if specified | ||
if (this.config.http) { | ||
require('http').createServer(function (req, res) { | ||
res.writeHead(302, {'Location': 'https://'+req.headers.host+req.url}); | ||
res.end(); | ||
}).listen(this.config.http.port); | ||
} | ||
} | ||
else { | ||
port = this.config.port || this.config.http.port; | ||
this.server = this.listen(this.config.http.port); | ||
} | ||
console.log('[ ' + this.constants.name + ' ] worker listening on port ' + port); | ||
this.emit('listen', this.server); | ||
} |
{ | ||
"name":"base12", | ||
"description":"12factor.net app platform for node.js, built on express 3", | ||
"version":"0.2.8", | ||
"version":"0.2.9", | ||
"author":"Hunter Loftis <hunter@hunterloftis.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1988709
964
4