瀏覽代碼

added HOSTNAME env variable

master
mortie 6 年之前
父節點
當前提交
1e381ee2e7
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 3
    2
      README.md
  2. 2
    2
      index.js

+ 3
- 2
README.md 查看文件

@@ -40,8 +40,9 @@ Options:
* `server`: Your own HTTP (like the one created by http.createHttpServer).
* `port`: The port to listen on. Defaults to the PORT environment variable, or
8080.
* `host`: The host to listen on. Defaults to "127.0.0.1". For the server to be
accessible to the outside world, listen on "0.0.0.0".
* `host`: The host to listen on. Defaults to the HOSTNAME environment variable,
or "127.0.0.1". For the server to be accessible to the outside world, listen
on "0.0.0.0".
* `client_utils`: Whether to add some utility functions to /webframe.js.
Defaults to false.
* `res404`: The string to return for a 404 error. "{{pathname}}" will be

+ 2
- 2
index.js 查看文件

@@ -44,8 +44,8 @@ class App {
} else {
this.server = http.createServer();

var port = options.port || process.env.PORT | 8080;
var host = options.host || "127.0.0.1";
var port = options.port || process.env.PORT || 8080;
var host = options.host || process.env.HOSTNAME || "127.0.0.1";

this.server.listen(port, host);
this.info("Listening on "+host+":"+port);

Loading…
取消
儲存