create-servers
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -73,4 +73,5 @@ /* | ||
options.http = { | ||
port: typeof options.http === 'number' | ||
? options.http | ||
// accept both a string and a number | ||
port: !isNaN(options.http) | ||
? +options.http | ||
: false | ||
@@ -105,3 +106,3 @@ }; | ||
var port = options.https.port || 443, | ||
var port = +options.https.port || 443, | ||
ssl = options.https, | ||
@@ -108,0 +109,0 @@ server, |
{ | ||
"name": "create-servers", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Create an http AND/OR an https server and call the same request handler.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -83,3 +83,3 @@ create-servers | ||
**http && http (different handlers)s** | ||
**http && https (different handlers)** | ||
``` js | ||
@@ -86,0 +86,0 @@ var servers = createServers( |
@@ -106,2 +106,17 @@ /* | ||
}); | ||
test('only http with string type input for http port', function (t) { | ||
t.plan(3); | ||
createServers({ | ||
log: console.log, | ||
http: "9876", | ||
handler: fend | ||
}, function (err, servers) { | ||
console.dir(err); | ||
t.error(err); | ||
t.equals(typeof servers, 'object'); | ||
t.equals(typeof servers.http, 'object'); | ||
servers.http.close(); | ||
}); | ||
}); | ||
}); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance 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
12609
230
4