Skip to content

Commit 1b8f9fe

Browse files
authored
Merge pull request #42 from simonh1000/minor-changes
update deps
2 parents a4a9b2a + 57ca2c7 commit 1b8f9fe

File tree

7 files changed

+806
-233
lines changed

7 files changed

+806
-233
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ font-awesome
22
ignore
33
node_modules
44
.DS_Store
5-
package-lock.json
65
.idea
76
tests

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,38 @@ angular-http-server --cors
4949
```
5050

5151
Specify a path to serve from
52+
5253
```sh
5354
angular-http-server --path example
5455
```
5556

5657
Specify the base href of the application
58+
5759
```sh
5860
angular-http-server --baseHref myapp
5961
```
6062

6163
Disable logging
64+
6265
```sh
6366
angular-http-server --silent
6467
```
6568

6669
All options can be specified by a config file, optionally read via `--config` flag.
6770
CLI options take precedence over any options read from the config file.
71+
6872
```sh
6973
angular-http-server --config configs/angular-http-server.config.js
7074
```
7175

7276
Feedback via: https://github.com/simonh1000/angular-http-server
7377

7478
## Config File
79+
7580
The config file can either export an object of parameters, or a function that will be passed in the parsed `argv` from minimalist.
7681

7782
Simple example:
83+
7884
```js
7985
module.exports = {
8086
p: 8081,
@@ -84,6 +90,7 @@ module.exports = {
8490
```
8591

8692
Complicated example:
93+
8794
```js
8895
module.exports = (argv) => {
8996
const config = {
@@ -106,12 +113,12 @@ The `--https` or `--ssl` flags are intended for development and/or testing purpo
106113

107114
## Changelog
108115

109-
- 1.9.0 - adds --baseHref (thanks bertbaron)
110-
- 1.8.0 - rewrite of path resolution (thanks dpraul)
111-
- 1.7.0 - add option to include own ssl certificate (thanks dpraul)
112-
- 1.6.0 - add --config option (thanks dpraul)
113-
- 1.5.0 - add --open option (thanks tluanga34)
114-
- 1.4.0 - add --path option (thanks nick-bogdanov)
116+
- 1.9.0 - adds --baseHref (thanks bertbaron)
117+
- 1.8.0 - rewrite of path resolution (thanks dpraul)
118+
- 1.7.0 - add option to include own ssl certificate (thanks dpraul)
119+
- 1.6.0 - add --config option (thanks dpraul)
120+
- 1.5.0 - add --open option (thanks tluanga34)
121+
- 1.4.0 - add --path option (thanks nick-bogdanov)
115122

116123
## Contributing
117124

@@ -122,8 +129,9 @@ Use prettier for formatting
122129
## Testing
123130

124131
Run unit tests with
132+
125133
```sh
126-
$ yarn run test
134+
$ npm run test
127135
```
128136

129137
Testing - try:

example/index.html

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<!DOCTYPE html>
22
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Example</title>
6+
<link rel="stylesheet" type="text/css" href="styles.css" />
7+
</head>
38

4-
<head>
5-
<meta charset="utf-8">
6-
<title>Dummy home page</title>
7-
</head>
8-
9-
<body>
10-
<h1>Angular HTTP Server</h1>
11-
<p>Up and running in this directory. Enjoy the pictures.</p>
12-
<img src="image.svg" alt="" width="500px" alt="example">
13-
<img src="beach.jpg" alt="" width="500px" alt="example">
14-
15-
<p>This <a href="/../../etc/passwd">link</a> should not work</p>
16-
</body>
9+
<body>
10+
<div class="container">
11+
<h1>Single Page App HTTP Server</h1>
12+
<p>Up and running in this directory. Enjoy the pictures.</p>
13+
<img src="image.svg" alt="" width="500px" alt="example" />
14+
<img src="beach.jpg" alt="" width="500px" alt="beach" />
1715

16+
<p>This <a href="/../../etc/passwd">link</a> should not work</p>
17+
</div>
18+
</body>
1819
</html>

example/styles.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
body {
2+
background-color: #eee;
3+
}
4+
.container {
5+
margin: 10px;
6+
padding: 0 10px;
7+
}

0 commit comments

Comments
 (0)