http-server-rs 0.0.35 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -33,7 +33,9 @@ npx http-server-rs --help # Uses the override
|
|
|
33
33
|
|
|
34
34
|
### Manual Install
|
|
35
35
|
|
|
36
|
-
Download the latest binary from [GitHub Releases](https://github.com/alshdavid-public/http-server-rs/releases/latest) and add it to your `PATH
|
|
36
|
+
Download the latest binary from [GitHub Releases](https://github.com/alshdavid-public/http-server-rs/releases/latest) and add it to your `PATH`.
|
|
37
|
+
|
|
38
|
+
Update with `http-server-rs update`
|
|
37
39
|
|
|
38
40
|
```bash
|
|
39
41
|
# Linux AMD64 (Change for your platform)
|
|
@@ -48,26 +50,41 @@ echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.bashrc
|
|
|
48
50
|
|
|
49
51
|
```bash
|
|
50
52
|
# Use default configuration
|
|
51
|
-
http-server-rs
|
|
53
|
+
http-server-rs serve
|
|
52
54
|
|
|
53
55
|
# Enable CORS, reroute requests to index.html and automatically compress served files
|
|
54
|
-
http-server-rs --cors --spa -Z ./public
|
|
56
|
+
http-server-rs serve --cors --spa -Z ./public
|
|
55
57
|
|
|
56
58
|
# Responds with headers required for SharedArrayBuffer
|
|
57
|
-
http-server-rs --shared-array-buffer ./public
|
|
59
|
+
http-server-rs serve --shared-array-buffer ./public
|
|
58
60
|
|
|
59
61
|
# Automatically transpiles TypeScript to JavaScript on request
|
|
60
|
-
http-server-rs --transpile ./public
|
|
62
|
+
http-server-rs serve --transpile ./public
|
|
61
63
|
|
|
62
64
|
# Proxy /api to an external backend (quotes are required)
|
|
63
|
-
http-server-rs --proxy "path=/api&target=http://localhost:3000" ./public
|
|
65
|
+
http-server-rs serve --proxy "path=/api&target=http://localhost:3000" ./public
|
|
64
66
|
|
|
65
67
|
# Custom Headers
|
|
66
|
-
http-server-rs -H X-Custom-Header:some-value
|
|
68
|
+
http-server-rs serve -H X-Custom-Header:some-value
|
|
69
|
+
|
|
70
|
+
# Update the binary to the latest release
|
|
71
|
+
http-server-rs update
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Usage: http-server-rs <COMMAND>
|
|
76
|
+
|
|
77
|
+
Commands:
|
|
78
|
+
serve Serve a target directory over HTTP
|
|
79
|
+
update Update the binary to the latest release
|
|
80
|
+
help Print this message or the help of the given subcommand(s)
|
|
81
|
+
|
|
82
|
+
Options:
|
|
83
|
+
-h, --help Print help
|
|
67
84
|
```
|
|
68
85
|
|
|
69
86
|
```
|
|
70
|
-
Usage: http-server-rs [OPTIONS] [SERVE_DIR]
|
|
87
|
+
Usage: http-server-rs serve [OPTIONS] [SERVE_DIR]
|
|
71
88
|
|
|
72
89
|
Arguments:
|
|
73
90
|
[SERVE_DIR] Target directory to serve [default: .]
|
|
@@ -101,10 +118,10 @@ Options:
|
|
|
101
118
|
Watch folder for changes and trigger a browser reload
|
|
102
119
|
--watch-dir <WATCH_DIR>
|
|
103
120
|
Watch for changes [default: SERVE_DIR]
|
|
121
|
+
--watch-debounce-delay <WATCH_DEBOUNCE_DELAY>
|
|
122
|
+
Debounce delay in milliseconds before watched changes trigger a reload [default: 200]
|
|
104
123
|
--no-watch-inject
|
|
105
124
|
Don't automatically inject watch listener into html
|
|
106
|
-
--upgrade
|
|
107
|
-
Upgrade the binary to the latest release
|
|
108
125
|
--skip-upgrade-check
|
|
109
126
|
Skip checking for a newer release on startup
|
|
110
127
|
--stream-buffer-size <STREAM_BUFFER_SIZE>
|
|
@@ -121,7 +138,7 @@ Will live transpile TypeScript to JavaScript on request. This allows serving Typ
|
|
|
121
138
|
directly to the browser without a build step.
|
|
122
139
|
|
|
123
140
|
```bash
|
|
124
|
-
http-server-rs --transpile --port 8080 ./testing/transpile/react
|
|
141
|
+
http-server-rs serve --transpile --port 8080 ./testing/transpile/react
|
|
125
142
|
|
|
126
143
|
# Returns transpiled JavaScript that runs directly in the browser
|
|
127
144
|
curl http://localhost:8080/app.tsx
|
|
@@ -132,13 +149,13 @@ curl http://localhost:8080/app.tsx
|
|
|
132
149
|
`http-server` under `--watch` mode can watch the served directory for changes and emit an event to the client notifying of a change. By default the server will intercept html files and inject a JavaScript script which subscribes to change events and triggers a page reload.
|
|
133
150
|
|
|
134
151
|
```bash
|
|
135
|
-
http-server --watch ./dist
|
|
152
|
+
http-server-rs serve --watch ./dist
|
|
136
153
|
```
|
|
137
154
|
|
|
138
155
|
To customize the reload functionality, disable the auto-inject script, manually subscribe to change events and trigger the desired functionality.
|
|
139
156
|
|
|
140
157
|
```bash
|
|
141
|
-
http-server --watch --no-watch-inject ./dist
|
|
158
|
+
http-server-rs serve --watch --no-watch-inject ./dist
|
|
142
159
|
```
|
|
143
160
|
|
|
144
161
|
```html
|
|
@@ -154,31 +171,3 @@ http-server --watch --no-watch-inject ./dist
|
|
|
154
171
|
</body>
|
|
155
172
|
</html>
|
|
156
173
|
```
|
|
157
|
-
|
|
158
|
-
## Installation
|
|
159
|
-
|
|
160
|
-
### MacOS & Linux
|
|
161
|
-
|
|
162
|
-
Download the binary from the [latest GitHub release](https://github.com/alshdavid/http-server-rs/releases/latest) and add it to your `PATH`
|
|
163
|
-
|
|
164
|
-
```shell
|
|
165
|
-
# Linux AMD64
|
|
166
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-rs-linux-amd64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
167
|
-
|
|
168
|
-
# Linux ARM64
|
|
169
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-rs-linux-arm64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
170
|
-
|
|
171
|
-
# MacOS ARM64 (Apple Silicon)
|
|
172
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-rs-macos-arm64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
173
|
-
|
|
174
|
-
# MacOS AMD64 (Intel)
|
|
175
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-rs-macos-amd64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
176
|
-
|
|
177
|
-
# Add to PATH if not already there:
|
|
178
|
-
echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.zshrc
|
|
179
|
-
echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.bashrc
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Windows
|
|
183
|
-
|
|
184
|
-
Download the binary from the [latest GitHub release](https://github.com/alshdavid/http-server-rs/releases/latest) and add it to your `PATH`
|
|
Binary file
|
|
Binary file
|
package/http-server-rs-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|