@@ -34,6 +34,25 @@ Check for the installation to be successful.
3434http-server --help
3535```
3636
37+ ## Configuration
38+
39+ When running the server with no options or flags provided, a set of default
40+ configurations will be set, you can always change this behavior by either
41+ creating your own config with the [ Configuration TOML] ( https://github.com/EstebanBorai/http-server/blob/main/fixtures/config.toml ) file
42+ or by providing CLI arguments described in the [ usage] ( #usage ) section.
43+
44+ Name | Description | Default
45+ --- | --- | ---
46+ Host | Address to bind the server | ` 127.0.0.1 `
47+ Port | Port to bind the server | ` 7878 `
48+ Root Directory | The directory to serve files from | ` CWD `
49+ File Explorer UI | A File Explorer UI for the directory configured as the _ Root Directory_ | Enabled
50+ Configuration File | Specifies a configuration file. [ Example] ( https://github.com/EstebanBorai/http-server/blob/main/fixtures/config.toml ) | Disabled
51+ HTTPS (TLS) | HTTPS Secure connection configuration. Refer to [ TLS (HTTPS)] ( https://github.com/EstebanBorai/http-server#tls-https ) reference | Disabled
52+ CORS | Cross-Origin-Resource-Sharing headers support. Refer to [ CORS] ( https://github.com/EstebanBorai/http-server#cross-origin-resource-sharing-cors ) reference | Disabled
53+ Compression | GZip compression for HTTP Response Bodies. Refer to [ Compression] ( https://github.com/EstebanBorai/http-server#compression ) reference | Disabled
54+ Verbose | Print server details when running. This doesn't include any logging capabilities. | Disabled
55+
3756## Usage
3857
3958```
@@ -81,14 +100,41 @@ solution that may be of the interest of the user.
81100
82101### Compression
83102
84- Compression with GZip encoding is supported, to enable it you must provide the ` compression `
85- section to the server configuration file.
103+ Even when compression is supported, by default the server will not compress any
104+ HTTP response contents.
105+
106+ You must specify the compression configuration you want to use, as of today
107+ the server only supports compression with the GZip algorithm, but ` brotli ` is
108+ also planed to be supported, that's why theres two ways to configure this
109+ server to use compression.
110+
111+ The following MIME types will be skipped from compression:
112+
113+ - ` application/gzip `
114+ - ` application/octet-stream `
115+ - ` application/wasm `
116+ - ` application/zip `
117+ - ` image/* `
118+ - ` video/* `
119+
120+ #### The Configuration File's Compression Section
121+
122+ As suppport for other compression algorithms is planned to be provided in the
123+ future, the configuration file already supports compression settings.
86124
87125``` toml
88126[compression ]
89127gzip = true
90128```
91129
130+ #### The ` --gzip ` flag
131+
132+ Provide the ` --gzip ` argument to the server when executing it.
133+
134+ ``` bash
135+ http-server --gzip
136+ ```
137+
92138### TLS (HTTPS)
93139
94140The TLS solution supported for this HTTP Server is built with [ rustls] ( https://github.com/ctz/rustls )
0 commit comments