http-server-rs 0.0.36 → 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: .]
|
|
@@ -105,8 +122,6 @@ Options:
|
|
|
105
122
|
Debounce delay in milliseconds before watched changes trigger a reload [default: 200]
|
|
106
123
|
--no-watch-inject
|
|
107
124
|
Don't automatically inject watch listener into html
|
|
108
|
-
--upgrade
|
|
109
|
-
Upgrade the binary to the latest release
|
|
110
125
|
--skip-upgrade-check
|
|
111
126
|
Skip checking for a newer release on startup
|
|
112
127
|
--stream-buffer-size <STREAM_BUFFER_SIZE>
|
|
@@ -123,7 +138,7 @@ Will live transpile TypeScript to JavaScript on request. This allows serving Typ
|
|
|
123
138
|
directly to the browser without a build step.
|
|
124
139
|
|
|
125
140
|
```bash
|
|
126
|
-
http-server-rs --transpile --port 8080 ./testing/transpile/react
|
|
141
|
+
http-server-rs serve --transpile --port 8080 ./testing/transpile/react
|
|
127
142
|
|
|
128
143
|
# Returns transpiled JavaScript that runs directly in the browser
|
|
129
144
|
curl http://localhost:8080/app.tsx
|
|
@@ -134,13 +149,13 @@ curl http://localhost:8080/app.tsx
|
|
|
134
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.
|
|
135
150
|
|
|
136
151
|
```bash
|
|
137
|
-
http-server --watch ./dist
|
|
152
|
+
http-server-rs serve --watch ./dist
|
|
138
153
|
```
|
|
139
154
|
|
|
140
155
|
To customize the reload functionality, disable the auto-inject script, manually subscribe to change events and trigger the desired functionality.
|
|
141
156
|
|
|
142
157
|
```bash
|
|
143
|
-
http-server --watch --no-watch-inject ./dist
|
|
158
|
+
http-server-rs serve --watch --no-watch-inject ./dist
|
|
144
159
|
```
|
|
145
160
|
|
|
146
161
|
```html
|
|
@@ -156,31 +171,3 @@ http-server --watch --no-watch-inject ./dist
|
|
|
156
171
|
</body>
|
|
157
172
|
</html>
|
|
158
173
|
```
|
|
159
|
-
|
|
160
|
-
## Installation
|
|
161
|
-
|
|
162
|
-
### MacOS & Linux
|
|
163
|
-
|
|
164
|
-
Download the binary from the [latest GitHub release](https://github.com/alshdavid/http-server-rs/releases/latest) and add it to your `PATH`
|
|
165
|
-
|
|
166
|
-
```shell
|
|
167
|
-
# Linux AMD64
|
|
168
|
-
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
|
|
169
|
-
|
|
170
|
-
# Linux ARM64
|
|
171
|
-
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
|
|
172
|
-
|
|
173
|
-
# MacOS ARM64 (Apple Silicon)
|
|
174
|
-
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
|
|
175
|
-
|
|
176
|
-
# MacOS AMD64 (Intel)
|
|
177
|
-
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
|
|
178
|
-
|
|
179
|
-
# Add to PATH if not already there:
|
|
180
|
-
echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.zshrc
|
|
181
|
-
echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.bashrc
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Windows
|
|
185
|
-
|
|
186
|
-
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
|