https://github.com/dsnet/file-server
Simple HTTP file server.
https://github.com/dsnet/file-server
Last synced: about 1 year ago
JSON representation
Simple HTTP file server.
- Host: GitHub
- URL: https://github.com/dsnet/file-server
- Owner: dsnet
- License: bsd-3-clause
- Created: 2021-07-05T07:30:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-03T11:41:32.000Z (over 2 years ago)
- Last Synced: 2025-03-27T06:22:29.511Z (about 1 year ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# File Server
This program is a simple HTTP file server.
## Usage
The server can be installed with:
```
$ go install github.com/dsnet/file-server@latest
```
The server is started up by running:
```
$ file-server
```
By default, the server starts up listening on `:8080` and
serves files from the current working directory.
For more options, see `file-server -help`:
```
Usage: ./file-server [OPTION]...
-addr string
The network address to listen on. (default ":8080")
-deny string
Regular expression of file paths to deny.
Paths matching this pattern are excluded from directory listings
and direct requests for this path report StatusForbidden.
-hide string
Regular expression of file paths to hide.
Paths matching this pattern are excluded from directory listings,
but direct requests for this path are still resolved. (default "/[.][^/]+/?$")
-index string
Regular expression of file paths to treat as index.html pages.
(e.g., '/index[.]html$'; default none)
-root string
Directory to serve files from. (default ".")
-sendfile
Allow the use of the sendfile syscall. (default true)
-verbose
Log every HTTP request.
```