http-server-rs 0.0.19 → 0.0.20

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
- # Rerun to update
14
+ # Installs globally
15
15
  cargo install http-server-rs
16
16
  ```
17
17
 
18
- ### Binary Install Script
18
+ ### NPM
19
19
 
20
20
  ```bash
21
- # Rerun to update
22
- eval $(curl -sSf https://raw.githubusercontent.com/alshdavid/http-server-rs/refs/heads/main/install.sh | sh)
21
+ # Installs to ./node_modules
22
+ npm install http-server-rs
23
+ npx http-server-rs --help
23
24
  ```
24
25
 
25
- ## Usage
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-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
- # Arguments
32
- # Enable CORS, reroute requests to index.html and automatically compress to brotli
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: ./dist]
73
+ [SERVE_DIR] Target directory to serve [default: ./]
44
74
 
45
75
  Options:
46
76
  -a, --address <ADDRESS>
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-server-rs",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {