Comparing version 0.15.2 to 0.15.3
@@ -28,2 +28,10 @@ <h1 align="center">Fastify</h1> | ||
Specifying an address is also supported: | ||
```js | ||
fastify.listen(3000, '127.0.0.1', err => { | ||
if (err) throw err | ||
}) | ||
``` | ||
<a name="route"></a> | ||
@@ -30,0 +38,0 @@ #### route |
@@ -156,6 +156,12 @@ 'use strict' | ||
function listen (port, cb) { | ||
function listen (port, address, cb) { | ||
const hasAddress = arguments.length === 3 | ||
const _cb = (hasAddress) ? cb : address | ||
fastify.ready(function (err) { | ||
if (err) return cb(err) | ||
server.listen(port, cb) | ||
if (err) return _cb(err) | ||
if (hasAddress) { | ||
server.listen(port, address, _cb) | ||
} else { | ||
server.listen(port, _cb) | ||
} | ||
}) | ||
@@ -162,0 +168,0 @@ } |
{ | ||
"name": "fastify", | ||
"version": "0.15.2", | ||
"version": "0.15.3", | ||
"description": "Fast and low overhead web framework, for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "fastify.js", |
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
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
157227
77
4233