http-server-rs 0.0.19 → 0.0.21
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
|
@@ -11,36 +11,66 @@ https://github.com/user-attachments/assets/7b6bbee0-3428-4c9f-80a6-2804ddac6e01
|
|
|
11
11
|
### Cargo
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
#
|
|
14
|
+
# Installs globally
|
|
15
15
|
cargo install http-server-rs
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### NPM
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
#
|
|
22
|
-
|
|
21
|
+
# Installs to ./node_modules
|
|
22
|
+
npm install http-server-rs
|
|
23
|
+
npx http-server-rs --help
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
If you want to override the binary used (for custom platforms)
|
|
27
|
+
```bash
|
|
28
|
+
npm install http-server-rs
|
|
29
|
+
|
|
30
|
+
export HTTP_SERVER_RS_BIN_OVERRIDE=/path/to/http-server-rs
|
|
31
|
+
npx http-server-rs --help # Uses the override
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Manual Install
|
|
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`
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Linux AMD64 (Change for your platform)
|
|
40
|
+
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
|
|
41
|
+
|
|
42
|
+
# Add to PATH if not already there:
|
|
43
|
+
echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.zshrc
|
|
44
|
+
echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.bashrc
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Example Usage
|
|
26
48
|
|
|
27
49
|
```bash
|
|
28
50
|
# Use default configuration
|
|
29
|
-
http-server
|
|
51
|
+
http-server-rs
|
|
52
|
+
|
|
53
|
+
# Enable CORS, reroute requests to index.html and automatically compress served files
|
|
54
|
+
http-server-rs --cors --spa -Z ./public
|
|
55
|
+
|
|
56
|
+
# Responds with headers required for SharedArrayBuffer
|
|
57
|
+
http-server-rs --shared-array-buffer ./public
|
|
58
|
+
|
|
59
|
+
# Automatically transpiles TypeScript to JavaScript on request
|
|
60
|
+
http-server-rs --transpile ./public
|
|
30
61
|
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
http-server --cors --spa -Z ./public
|
|
62
|
+
# Proxy /api to an external backend (quotes are required)
|
|
63
|
+
http-server-rs --proxy "path=/api&target=http://localhost:3000" ./public
|
|
34
64
|
|
|
35
65
|
# Custom Headers
|
|
36
|
-
http-server -H X-Custom-Header:some-value
|
|
66
|
+
http-server-rs -H X-Custom-Header:some-value
|
|
37
67
|
```
|
|
38
68
|
|
|
39
69
|
```
|
|
40
70
|
Usage: http-server-rs [OPTIONS] [SERVE_DIR]
|
|
41
71
|
|
|
42
72
|
Arguments:
|
|
43
|
-
[SERVE_DIR] Target directory to serve [default: ./
|
|
73
|
+
[SERVE_DIR] Target directory to serve [default: ./]
|
|
44
74
|
|
|
45
75
|
Options:
|
|
46
76
|
-a, --address <ADDRESS>
|
|
@@ -127,16 +157,16 @@ Download the binary from the [latest GitHub release](https://github.com/alshdavi
|
|
|
127
157
|
|
|
128
158
|
```shell
|
|
129
159
|
# Linux AMD64
|
|
130
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-linux-amd64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
160
|
+
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
|
|
131
161
|
|
|
132
162
|
# Linux ARM64
|
|
133
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-linux-arm64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
163
|
+
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
|
|
134
164
|
|
|
135
165
|
# MacOS ARM64 (Apple Silicon)
|
|
136
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-macos-arm64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
166
|
+
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
|
|
137
167
|
|
|
138
168
|
# MacOS AMD64 (Intel)
|
|
139
|
-
curl -L --url https://github.com/alshdavid/http-server-rs/releases/latest/download/http-server-macos-amd64.tar.gz | tar -xvzf - -C $HOME/.local/bin
|
|
169
|
+
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
|
|
140
170
|
|
|
141
171
|
# Add to PATH if not already there:
|
|
142
172
|
echo "\nexport \PATH=\$PATH:\$HOME/.local/bin\n" >> $HOME/.zshrc
|
|
Binary file
|
|
Binary file
|
package/http-server-rs-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|