You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Angular-HTTP-Server
1
+
# Single Page App dev-server
2
2
3
-
A very simple application server designed for Single Page App (SPA) developers.
3
+
A simple dev-server designed for Single Page App (SPA) developers.**`angular-http-server` is not, and makes no claims to be, a production server.**
4
4
5
-
It returns a file to the browser if it exists (ex. your-icon.png, index.html) and if can't find a file that matches a given URL it re-directs you to index.html rather than giving a 404 error. The only time it will error out is if it can't locate the index.html file.
5
+
It returns a file if it exists (ex. your-icon.png, index.html), routes all other requests to index.html (rather than giving a 404 error) so that you SPO's routing can take over. The only time it will error out is if it can't locate the index.html file.
6
6
7
-
Originally designed for my Angular work, this server will work with any Single Page App (SPA) framework that uses a router to change the URL (React, Vue JS, Elm,...).
7
+
Originally designed for my Angular work, this dev-server will work with any Single Page App (SPA) framework that uses URL routing (React, Vue JS, Elm,...).
8
8
9
9
## To use:
10
10
@@ -24,6 +24,12 @@ Specify a port using `-p <port number>`
24
24
angular-http-server -p 9000
25
25
```
26
26
27
+
Open in a default browser automatically by using `--open` alias `-o`
28
+
29
+
```sh
30
+
angular-http-server --open
31
+
```
32
+
27
33
HTTPS can be enabled (using a generated self-signed certificate) with `--https` or `--ssl`
**`angular-http-server` is not, and makes no claims to be, a production server.** The `--https` or `--ssl` flagsare intended for development and/or testing purposes only. Self-signed certificates do not properly verify the identity of the web app and they will cause an end-users web browser to display an error.
56
-
57
-
Within a production env use `angular-http-server` in http mode and forward traffic to it from an SSL-enabled reverse-proxy server (ie. [NGINX](https://www.nginx.com/resources/admin-guide/reverse-proxy/)).
58
-
59
-
#### Development
60
-
Only use `angular-http-server` with a self-signed certificate for development and/or testing. This can be accomplished by using the self-signed certificate generated when you pass the `--https`/`--ssl` flag. An example of when you should use this feature is with end-to-end testing suites such as [Protractor](http://www.protractortest.org/). or other suites which require the SPA application to be actively served.
61
+
The `--https` or `--ssl` flags are intended for development and/or testing purposes only. Self-signed certificates do not properly verify the identity of the web app and they will cause an end-users web browser to display an error. Only use `angular-http-server` with a self-signed certificate for development and/or testing. This can be accomplished by using the self-signed certificate generated when you pass the `--https`/`--ssl` flag. An example of when you should use this feature is with end-to-end testing suites such as [Protractor](http://www.protractortest.org/). or other suites which require the SPA application to be actively served.
61
62
62
63
## Changelog
63
64
65
+
1.5.0 - add --open option
64
66
1.4.0 - add --path option
65
67
66
68
## Dev notes
69
+
67
70
Test latest version, e.g.
68
71
```sh
69
72
node angular-http-server.js --path example --ssl -p 9000
0 commit comments