file-server

command module
v0.0.0-...-a688de2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: BSD-3-Clause Imports: 17 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.

Jump to

Keyboard shortcuts

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