see is a static web server, developed using rust.
Quick Start
see start
# or
see start 8080Start according to the configuration file
see
# or
see -c /your/config.ymlMore
USAGE:
see [OPTIONS] [FLAGS] [--] ...
FLAGS:
-d Running in the background
-h, help Print help information
-s, stop Stop the daemon
-t Check the config file for errors
-v, version Print version number
OPTIONS:
-c <FILE> Specify a configuration file
start <PORT?> Quick Start
Use yaml format as a configuration file, You can use see -c /your/config.yml to specify the configuration file location.
Complete configuration file example:
- server:
host: domain.com # Domain name to be bound
listen: 80 # Port to be monitored
root: /root/www # Directory that requires service
index: index.html # Index file
directory: # Whether to display the file list
time: true
size: true
header: # Header in response
Access-Control-Allow-Origin: "*"
Set-Cookie: "12345"
rewrite: # Default 302
/img: /images 301
/url: https://example.com 302
/html: /index.html path
compress: # File type that needs to be compressed
mode: gzip
extension:
- css
- js
method: # Method of allowing requests
- POST
- PUT
auth: # Http user and password verification
user: name
password: pwd
extension: # Sets file extension fallbacks
- html
- htm
error: # Custom error page
404: 404.html
500: 500.html
log: # Log save location
error: /logs/error.log
success: /logs/success.log
# More server ...