Skip to content

Commit 806c5dd

Browse files
authored
Merge pull request #61 from jpwerka/Feat-config-host-suport
Feat: Add suport to host config
2 parents be41e7a + 97c2002 commit 806c5dd

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ Specify the rootFile of the application
6666
angular-http-server --rootFile myindex.html
6767
```
6868

69+
Specify the host of the application. It's used when open is true to redirect browser to navigate for the host. Example: http://mydomain.local:8080
70+
71+
```sh
72+
angular-http-server --open --host mydomain.local
73+
```
74+
6975
Disable logging
7076

7177
```sh
@@ -155,6 +161,7 @@ The `--https` or `--ssl` flags are intended for **development and/or testing pur
155161

156162
## Changelog
157163

164+
- 1.12.0 - adds host support (thanks jpwerka)
158165
- 1.11.0 - adds proxy support (thanks AVierwind)
159166
- 1.10.0 - adds --rootPath (thanks Aakash)
160167
- 1.9.0 - adds --baseHref (thanks bertbaron)

lib/angular-http-server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ function start() {
7676
server.listen(port, function () {
7777
if (argv.open == true || argv.o) {
7878
// open a browser tab
79-
opn((useHttps ? "https" : "http") + "://localhost:" + port);
79+
const host = argv.host || "localhost"
80+
opn((useHttps ? "https" : "http") + "://" + host + ":" + port);
8081
}
8182
return console.log("Listening on " + port);
8283
});

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-http-server",
3-
"version": "1.11.3",
3+
"version": "1.12.0",
44
"author": "Simon Hampton",
55
"license": "ISC",
66
"description": "Simple http server for developers of apps with client side routing",

0 commit comments

Comments
 (0)