Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro authored Feb 6, 2025
1 parent dfa37fd commit 3f6b9aa
Showing 1 changed file with 78 additions and 64 deletions.
142 changes: 78 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,94 +138,95 @@ Usage: miniserve [OPTIONS] [PATH]
Arguments:
[PATH]
Which path to serve
[env: MINISERVE_PATH=]
Options:
-v, --verbose
Be verbose, includes emitting access logs
[env: MINISERVE_VERBOSE=]
--index <INDEX>
The name of a directory index file to serve, like "index.html"
Normally, when miniserve serves a directory, it creates a listing for that directory. However, if a directory
contains this file, miniserve will serve that file instead.
Normally, when miniserve serves a directory, it creates a listing for that directory. However, if a
directory contains this file, miniserve will serve that file instead.
[env: MINISERVE_INDEX=]
--spa
Activate SPA (Single Page Application) mode
This will cause the file given by --index to be served for all non-existing file paths. In effect, this will serve
the index file whenever a 404 would otherwise occur in order to allow the SPA router to handle the request instead.
This will cause the file given by --index to be served for all non-existing file paths. In effect,
this will serve the index file whenever a 404 would otherwise occur in order to allow the SPA
router to handle the request instead.
[env: MINISERVE_SPA=]
--pretty-urls
Activate Pretty URLs mode
This will cause the server to serve the equivalent `.html` file indicated by the path.
`/about` will try to find `about.html` and serve it.
[env: MINISERVE_PRETTY_URLS=]
-p, --port <PORT>
Port to use
[env: MINISERVE_PORT=]
[default: 8080]
-i, --interfaces <INTERFACES>
Interface to listen on
[env: MINISERVE_INTERFACE=]
-a, --auth <AUTH>
Set authentication
Currently supported formats:
username:password, username:sha256:hash, username:sha512:hash
(e.g. joe:123, joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3)
[env: MINISERVE_AUTH=]
--auth-file <AUTH_FILE>
Read authentication values from a file
Example file content:
joe:123
bob:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3
bill:
[env: MINISERVE_AUTH_FILE=]
--route-prefix <ROUTE_PREFIX>
Use a specific route prefix
[env: MINISERVE_ROUTE_PREFIX=]
--random-route
Generate a random 6-hexdigit route
[env: MINISERVE_RANDOM_ROUTE=]
-P, --no-symlinks
Hide symlinks in listing and prevent them from being followed
[env: MINISERVE_NO_SYMLINKS=]
-H, --hidden
Show hidden files
[env: MINISERVE_HIDDEN=]
-S, --default-sorting-method <DEFAULT_SORTING_METHOD>
Default sorting method for file list
[env: MINISERVE_DEFAULT_SORTING_METHOD=]
[default: name]
Expand All @@ -236,7 +237,7 @@ Options:
-O, --default-sorting-order <DEFAULT_SORTING_ORDER>
Default sorting order for file list
[env: MINISERVE_DEFAULT_SORTING_ORDER=]
[default: desc]
Expand All @@ -246,146 +247,159 @@ Options:
-c, --color-scheme <COLOR_SCHEME>
Default color scheme
[env: MINISERVE_COLOR_SCHEME=]
[default: squirrel]
[possible values: squirrel, archlinux, zenburn, monokai]
-d, --color-scheme-dark <COLOR_SCHEME_DARK>
Default color scheme
[env: MINISERVE_COLOR_SCHEME_DARK=]
[default: archlinux]
[possible values: squirrel, archlinux, zenburn, monokai]
-q, --qrcode
Enable QR code display
[env: MINISERVE_QRCODE=]
-u, --upload-files [<ALLOWED_UPLOAD_DIR>]
Enable file uploading (and optionally specify for which directory)
The provided path is not a physical file system path. Instead, it's relative to the serve dir. For
instance, if the serve dir is '/home/hello', set this to '/upload' to allow uploading to
'/home/hello/upload'. When specified via environment variable, a path always needs to be specified.
[env: MINISERVE_ALLOWED_UPLOAD_DIR=]
-U, --mkdir
Enable creating directories
[env: MINISERVE_MKDIR_ENABLED=]
-m, --media-type <MEDIA_TYPE>
Specify uploadable media types
[env: MINISERVE_MEDIA_TYPE=]
[possible values: image, audio, video]
-M, --raw-media-type <MEDIA_TYPE_RAW>
Directly specify the uploadable media type expression
[env: MINISERVE_RAW_MEDIA_TYPE=]
-o, --overwrite-files
Enable overriding existing files during file upload
[env: MINISERVE_OVERWRITE_FILES=]
-r, --enable-tar
Enable uncompressed tar archive generation
[env: MINISERVE_ENABLE_TAR=]
-g, --enable-tar-gz
Enable gz-compressed tar archive generation
[env: MINISERVE_ENABLE_TAR_GZ=]
-z, --enable-zip
Enable zip archive generation
WARNING: Zipping large directories can result in out-of-memory exception because zip generation is done in memory
and cannot be sent on the fly
WARNING: Zipping large directories can result in out-of-memory exception because zip generation is
done in memory and cannot be sent on the fly
[env: MINISERVE_ENABLE_ZIP=]
-C, --compress-response
Compress response
WARNING: Enabling this option may slow down transfers due to CPU overhead, so it is disabled by default.
Only enable this option if you know that your users have slow connections or if you want to minimize your server's bandwidth usage.
WARNING: Enabling this option may slow down transfers due to CPU overhead, so it is disabled by
default.
Only enable this option if you know that your users have slow connections or if you want to
minimize your server's bandwidth usage.
[env: MINISERVE_COMPRESS_RESPONSE=]
-D, --dirs-first
List directories first
[env: MINISERVE_DIRS_FIRST=]
-t, --title <TITLE>
Shown instead of host in page title and heading
[env: MINISERVE_TITLE=]
--header <HEADER>
Inserts custom headers into the responses. Specify each header as a 'Header:Value' pair.
This parameter can be used multiple times to add multiple headers.
Example:
--header "Header1:Value1" --header "Header2:Value2"
(If a header is already set or previously inserted, it will not be overwritten.)
Inserts custom headers into the responses. Specify each header as a 'Header:Value' pair. This
parameter can be used multiple times to add multiple headers.
Example: --header "Header1:Value1" --header "Header2:Value2" (If a header is already set or
previously inserted, it will not be overwritten.)
[env: MINISERVE_HEADER=]
-l, --show-symlink-info
Visualize symlinks in directory listing
[env: MINISERVE_SHOW_SYMLINK_INFO=]
-F, --hide-version-footer
Hide version footer
[env: MINISERVE_HIDE_VERSION_FOOTER=]
--hide-theme-selector
Hide theme selector
[env: MINISERVE_HIDE_THEME_SELECTOR=]
-W, --show-wget-footer
If enabled, display a wget command to recursively download the current directory
[env: MINISERVE_SHOW_WGET_FOOTER=]
--print-completions <shell>
Generate completion file for a shell
[possible values: bash, elvish, fish, powershell, zsh]
--print-manpage
Generate man page
--tls-cert <TLS_CERT>
TLS certificate to use
[env: MINISERVE_TLS_CERT=]
--tls-key <TLS_KEY>
TLS private key to use
[env: MINISERVE_TLS_KEY=]
--readme
Enable README.md rendering in directories
[env: MINISERVE_README=]
-I, --disable-indexing
Disable indexing
This will prevent directory listings from being generated and return an error instead.
[env: MINISERVE_DISABLE_INDEXING=]
--enable-webdav
Enable read-only WebDAV support (PROPFIND requests)
Currently incompatible with -P|--no-symlinks (see
https://github.com/messense/dav-server-rs/issues/37)
[env: MINISERVE_ENABLE_WEBDAV=]
-h, --help
Print help (see a summary with '-h')
Expand Down

0 comments on commit 3f6b9aa

Please sign in to comment.