项目作者: kevinpollet

项目描述 :
Simple, secure and modern Go HTTP server to serve static sites, single-page applications or a file with ease
高级语言: Go
项目地址: git://github.com/kevinpollet/srv.git
创建时间: 2020-02-26T09:15:28Z
项目社区:https://github.com/kevinpollet/srv

开源协议:MIT License

下载


serve

Build Status

Simple and secure Go HTTP server to serve static sites or files from the command-line.

  • HTTP/2 and TLS support.
  • Custom Error pages.
  • Basic HTTP authentication.
  • Hide dot files by default.
  • Directory listing is disabled by default.
  • Encoding negotiation with support of gzip, Deflate
    and Brotli compression algorithms.

Installation

  1. go install github.com/kevinpollet/serve

Usage

  1. Usage: serve [options]
  2. Options:
  3. -addr Sets the server address. Default is "127.0.0.1:8080".
  4. -auth Sets the basic auth credentials (password must be hashed with bcrypt and escaped with '').
  5. -auth-file Sets the basic auth credentials following the ".htpasswd" format.
  6. -dir Sets the directory containing the files to serve. Default is ".".
  7. -cert Sets the TLS certificate.
  8. -key Sets the TLS private key.
  9. -help Prints this text.

Docker

A Docker image is available to serve static files from a running Docker
container. By default, all files located in the /var/www/ directory will be made available through TCP connections on
port 8080. For more details, check out the Docker example.

Examples

  • hello — Simple static site that can be served from the command-line.
  • docker — Simple static site that can be served from a Docker container.

Contributing

PRs welcome!

Want to file a bug or request a feature?

  1. Check out the Code of Conduct.
  2. Check for an existing issue corresponding to your bug or feature request.
  3. Open an issue to describe your bug or feature request.

License

MIT