A lightweight static file HTTP server.
- Supports multiple path mappings
- Supports Angular routing
- Supports custom index files
- Supports TLS (HTTPS)
- Supports Basic Authentication
- Supports file compression
- Supports log files and colorful console output
- Supports file uploads
Maps the current directory to the web root. The default port is 8080.
./simplehttpserverOpen your browser and visit:
http://localhost:8080
Maps the dist directory to the web root, uses port 4200, serves index.html as the default file, and falls back to index.html for client-side routing.
./simplehttpserver -addr :4200 -path dist -indexnames index.html -fallback index.htmlFirst, use mkcert to generate development certificates.
mkcert -install
mkcert -cert-file ssl-cert.pem -key-file ssl-cert.key localhost 127.0.0.1 ::1Then start the server with TLS enabled:
./simplehttpserver -addrtls :8081 -certfile ssl-cert.pem -keyfile ssl-cert.key -username admin -password admin -logfile 1.logOpen your browser and visit:
https://localhost:8081
./simplehttpserver -makeconfig config.yamlYou can configure multiple path mappings.
Lines beginning with # are treated as comments.
addr: 0.0.0.0:8080
#addrtls: 0.0.0.0:8081
#certfile: ./ssl-cert.pem
#keyfile: ./ssl-cert.key
#username: admin
#password: admin
compress: false
paths:
#/c: "C:\\"
#/d: "D:\\"
indexnames:
- index.html
- index.htm
verbose: true
enablecolor: true
enableupload: true
## Set maxrequestbodysize to 0 to use the default size
maxrequestbodysize: 9223372036854775807
## Set timeout to 0s for no timeout limit
readtimeout: 0s
writetimeout: 0s
logfile: ./simplehttpserver.log
#fallback: ./index.html
#HTTP_PROXY:
#HTTPS_PROXY:
#NO_PROXY: ::1,127.0.0.1,localhost./simplehttpserver -config config.yaml./simplehttpserver -helpbash ./build.shPowered by httpserver-master created By httpserver-master For AirSPACEx