88
99<div align =" center " >
1010
11- [ ![ Crates.io] ( https://img.shields.io/crates/v/http-server.svg )] ( https://crates.io/crates/http-server )
12- [ ![ Documentation] ( https://docs.rs/http-server/badge.svg )] ( https://docs.rs/http-server )
13- ![ Build] ( https://github.com/http-server-rs/http-server/workflows/build/badge.svg )
14- ![ Clippy] ( https://github.com/http-server-rs/http-server/workflows/clippy/badge.svg )
15- ![ Formatter] ( https://github.com/http-server-rs/http-server/workflows/fmt/badge.svg )
16- ![ Tests] ( https://github.com/http-server-rs/http-server/workflows/test/badge.svg )
17- ![ Benchs ] ( https://github.com/http-server-rs/http-server/workflows/bench/badge.svg )
11+ [ ![ Crates.io] ( https://img.shields.io/crates/v/http-server.svg )] ( https://crates.io/crates/http-server )
12+ [ ![ Documentation] ( https://docs.rs/http-server/badge.svg )] ( https://docs.rs/http-server )
13+ ![ Build] ( https://github.com/http-server-rs/http-server/workflows/build/badge.svg )
14+ ![ Clippy] ( https://github.com/http-server-rs/http-server/workflows/clippy/badge.svg )
15+ ![ Formatter] ( https://github.com/http-server-rs/http-server/workflows/fmt/badge.svg )
16+ ![ Tests] ( https://github.com/http-server-rs/http-server/workflows/test/badge.svg )
17+ ![ Benches ] ( https://github.com/http-server-rs/http-server/workflows/bench/badge.svg )
1818
1919</div >
2020
@@ -45,10 +45,12 @@ FLAGS:
4545 --graceful-shutdown Waits for all requests to fulfill before shutting down the server
4646 --gzip Enable GZip compression for HTTP Responses
4747 --help Prints help information
48- --logger Prints HTTP request and response details to stdout
48+ -l, --logger Prints HTTP request and response details to stdout
49+ -q, --quiet Turns off stdout/stderr logging
50+ --spa Route non-existent files to /index.html
4951 --tls Enables HTTPS serving using TLS
52+ -i, --index Route directories to index.html if present
5053 -V, --version Prints version information
51- -q, --quiet Turns off stdout/stderr logging
5254
5355OPTIONS:
5456 -c, --config <config> Path to TOML configuration file
@@ -74,19 +76,21 @@ configurations will be used. You can always change this behavior by either
7476creating your own config with the [ Configuration TOML] ( https://github.com/http-server-rs/http-server/blob/main/fixtures/config.toml ) file
7577or by providing CLI arguments described in the [ usage] ( #usage ) section.
7678
77- Name | Description | Default
78- --- | --- | ---
79- Host | Address to bind the server | ` 127.0.0.1 `
80- Port | Port to bind the server | ` 7878 `
81- Root Directory | The directory to serve files from | ` CWD `
82- File Explorer UI | A File Explorer UI for the directory configured as the _ Root Directory_ | Enabled
83- Configuration File | Specifies a configuration file. [ Example] ( https://github.com/http-server-rs/http-server/blob/main/fixtures/config.toml ) | Disabled
84- HTTPS (TLS) | HTTPS Secure connection configuration. Refer to [ TLS (HTTPS)] ( https://github.com/http-server-rs/http-server#tls-https ) reference | Disabled
85- CORS | Cross-Origin-Resource-Sharing headers support. Refer to [ CORS] ( https://github.com/http-server-rs/http-server#cross-origin-resource-sharing-cors ) reference | Disabled
86- Compression | GZip compression for HTTP Response Bodies. Refer to [ Compression] ( https://github.com/http-server-rs/http-server#compression ) reference | Disabled
87- Quiet | Don't print server details when running. This doesn't include any logging capabilities. | Disabled
88- Basic Authentication | Authorize requests using Basic Authentication. Refer to [ Basic Authentication] ( https://github.com/http-server-rs/http-server#basic-authentication ) | Disabled
89- Logger | Prints HTTP request and response details to stdout | Disabled
79+ | Name | Description | Default |
80+ | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
81+ | Host | Address to bind the server | ` 127.0.0.1 ` |
82+ | Port | Port to bind the server | ` 7878 ` |
83+ | Root Directory | The directory to serve files from | ` CWD ` |
84+ | File Explorer UI | A File Explorer UI for the directory configured as the _ Root Directory_ | Enabled |
85+ | Configuration File | Specifies a configuration file. [ Example] ( https://github.com/http-server-rs/http-server/blob/main/fixtures/config.toml ) | Disabled |
86+ | HTTPS (TLS) | HTTPS Secure connection configuration. Refer to [ TLS (HTTPS)] ( https://github.com/http-server-rs/http-server#tls-https ) reference | Disabled |
87+ | CORS | Cross-Origin-Resource-Sharing headers support. Refer to [ CORS] ( https://github.com/http-server-rs/http-server#cross-origin-resource-sharing-cors ) reference | Disabled |
88+ | Compression | GZip compression for HTTP Response Bodies. Refer to [ Compression] ( https://github.com/http-server-rs/http-server#compression ) reference | Disabled |
89+ | Quiet | Don't print server details when running. This doesn't include any logging capabilities. | Disabled |
90+ | Index | Route directories to index.html if present | Disabled |
91+ | SPA | Route non-existent files to /index.html | Disabled |
92+ | Basic Authentication | Authorize requests using Basic Authentication. Refer to [ Basic Authentication] ( https://github.com/http-server-rs/http-server#basic-authentication ) | Disabled |
93+ | Logger | Prints HTTP request and response details to stdout | Disabled |
9094
9195## Usage
9296
@@ -102,15 +106,17 @@ Flags are provided without any values. For example:
102106http-server --help
103107```
104108
105- Name | Short | Long | Description
106- --- | --- | --- | ---
107- Cross-Origin Resource Sharing | N/A | ` --cors ` | Enable Cross-Origin Resource Sharing allowing any origin
108- GZip Compression | N/A | ` --gzip ` | Enable GZip compression for responses
109- Graceful Shutdown | N/A | ` --graceful-shutdown ` | Wait for all requests to be fulfilled before shutting down the server
110- Help | N/A | ` --help ` | Print help information
111- Logger | ` -l ` | ` --logger ` | Print HTTP request and response details to stdout
112- Version | ` -V ` | ` --version ` | Print version information
113- Quiet | ` -q ` | ` --quiet ` | Don't print output to console
109+ | Name | Short | Long | Description |
110+ | ----------------------------- | ----- | --------------------- | --------------------------------------------------------------------- |
111+ | Cross-Origin Resource Sharing | N/A | ` --cors ` | Enable Cross-Origin Resource Sharing allowing any origin |
112+ | GZip Compression | N/A | ` --gzip ` | Enable GZip compression for responses |
113+ | Graceful Shutdown | N/A | ` --graceful-shutdown ` | Wait for all requests to be fulfilled before shutting down the server |
114+ | Help | N/A | ` --help ` | Print help information |
115+ | Logger | ` -l ` | ` --logger ` | Print HTTP request and response details to stdout |
116+ | Version | ` -V ` | ` --version ` | Print version information |
117+ | Quiet | ` -q ` | ` --quiet ` | Don't print output to console |
118+ | Index | ` -i ` | ` --index ` | Route directories to index.html if present |
119+ | SPA | N/A | ` --spa ` | Route non-existent files to /index.html |
114120
115121### Options
116122
@@ -120,18 +126,18 @@ Options receive a value and support default values as well.
120126http-server --host 127.0.0.1
121127```
122128
123- Name | Short | Long | Description | Default Value
124- --- | --- | --- | --- | ---
125- Host | ` -h ` | ` --host ` | Address to bind the server | ` 127.0.0.1 `
126- Port | ` -p ` | ` --port ` | Port to bind the server | ` 7878 `
127- Configuration File | ` -c ` | ` --config ` | Configuration file. [ Example] ( https://github.com/http-server-rs/http-server/blob/main/fixtures/config.toml ) | N/A
128- TLS | N/A | ` --tls ` | Enable TLS for HTTPS connections. Requires a Certificate and Key. [ Reference] ( #tls-reference ) | N/A
129- TLS Ceritificate | N/A | ` --tls-cert ` | Path to TLS certificate file. ** Depends on ` --tls ` ** | ` cert.pem `
130- TLS Key | N/A | ` --tls-key ` | Path to TLS key file. ** Depends on ` --tls ` ** | ` key.rsa `
131- TLS Key Algorithm | N/A | ` --tls-key-algorithm ` | Algorithm used to generate certificate key. ** Depends on ` --tls ` ** | ` rsa `
132- Username | N/A | ` --username ` | Username to validate using basic authentication | N/A
133- Password | N/A | ` --password ` | Password to validate using basic authentication. ** Depends on ` --username ` ** | N/A
134- Proxy | N/A | ` --proxy ` | Proxy requests to the provided URL | N/A
129+ | Name | Short | Long | Description | Default Value |
130+ | ------------------ | ----- | --------------------- | ----------------------------------------------------------------------------------------------------------- | ------------- |
131+ | Host | ` -h ` | ` --host ` | Address to bind the server | ` 127.0.0.1 ` |
132+ | Port | ` -p ` | ` --port ` | Port to bind the server | ` 7878 ` |
133+ | Configuration File | ` -c ` | ` --config ` | Configuration file. [ Example] ( https://github.com/http-server-rs/http-server/blob/main/fixtures/config.toml ) | N/A |
134+ | TLS | N/A | ` --tls ` | Enable TLS for HTTPS connections. Requires a Certificate and Key. [ Reference] ( #tls-reference ) | N/A |
135+ | TLS Certificate | N/A | ` --tls-cert ` | Path to TLS certificate file. ** Depends on ` --tls ` ** | ` cert.pem ` |
136+ | TLS Key | N/A | ` --tls-key ` | Path to TLS key file. ** Depends on ` --tls ` ** | ` key.rsa ` |
137+ | TLS Key Algorithm | N/A | ` --tls-key-algorithm ` | Algorithm used to generate certificate key. ** Depends on ` --tls ` ** | ` rsa ` |
138+ | Username | N/A | ` --username ` | Username to validate using basic authentication | N/A |
139+ | Password | N/A | ` --password ` | Password to validate using basic authentication. ** Depends on ` --username ` ** | N/A |
140+ | Proxy | N/A | ` --proxy ` | Proxy requests to the provided URL | N/A |
135141
136142## Request Handlers
137143
@@ -285,7 +291,7 @@ open an issue to be assigned and track the progress there.
285291
286292- [x] Logging
287293 - [x] Request/Response Logging
288- - [x] Service Config Loggins
294+ - [x] Service Config Logins
289295- [ ] File Explorer
290296 - [x] Modified Date
291297 - [x] File Size
0 commit comments