file-server

command module
v0.0.0-...-7fce3ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2025 License: BSD-3-Clause Imports: 18 Imported by: 0

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
fsx
Package fsx extends the fs package with write interfaces.
Package fsx extends the fs package with write interfaces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL