Comparing version 4.0.2 to 4.1.0
@@ -0,1 +1,4 @@ | ||
2019/04/15 Version 4.1.0 | ||
- Add ability to set the host in cli mode | ||
2019/04/14 Version 4.0.2 | ||
@@ -2,0 +5,0 @@ - Add dependency for is-finished library |
@@ -72,1 +72,2 @@ General format is: contributor, github handle, email. In some cases, the | ||
* Robert Nagy @ronag <ronagy@icloud.com> | ||
* Ji WenCong <taiki_akita@163.com> |
@@ -21,2 +21,3 @@ #!/usr/bin/env node | ||
const port = envPORT > 1024 && envPORT <= 65536 ? envPORT : opts.port || opts.p || 8000; | ||
const host = process.env.HOST || opts.host || '0.0.0.0'; | ||
const dir = opts.root || opts._[0] || process.cwd(); | ||
@@ -28,7 +29,8 @@ | ||
} else { | ||
http.createServer(ecstatic(dir, opts)) | ||
.listen(port, () => { | ||
console.log(`ecstatic serving ${dir} at http://0.0.0.0:${port}`); | ||
const server = http.createServer(ecstatic(dir, opts)) | ||
.listen(port, host, () => { | ||
const bind = server.address(); | ||
console.log(`ecstatic serving ${dir} at http://${bind.address}:${bind.port}`); | ||
}) | ||
; | ||
} |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple static file server middleware", | ||
"version": "4.0.2", | ||
"version": "4.1.0", | ||
"homepage": "https://github.com/jfhbrook/node-ecstatic", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -124,2 +124,9 @@ # Ecstatic [![build status](https://secure.travis-ci.org/jfhbrook/node-ecstatic.png)](http://travis-ci.org/jfhbrook/node-ecstatic) [![codecov.io](https://codecov.io/github/jfhbrook/node-ecstatic/coverage.svg?branch=master)](https://codecov.io/github/jfhbrook/node-ecstatic?branch=master) | ||
### `opts.host` | ||
### `--host {host}` | ||
In CLI mode, `opts.host` is the host you want ecstatic to listen to. Defaults | ||
to 0.0.0.0. This can be overridden with the `--host` flag or with the HOST | ||
environment variable. | ||
### `opts.port` | ||
@@ -126,0 +133,0 @@ ### `--port {port}` |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
317580
1332
352
6