A simple HTTP file server in a single executable file.
- Download the binary for your platform from here.
- Move the binary to an installation directory of your choice.
- Add the installation directory to your environment path.
cd root/of/project/you/want/to/serve
serveitserveit -port=7070serveit -not-found-file=404.htmlFor single-page applications, this flag is typically set to index.html.
Serveit makes it simple to serve files over HTTPS by automatically creating self-signed certificates:
serveit -tlsThis command automatically generates the following files if they don't already exist:
serveit_root_ca.key |
Private key for Root Certificate Aurthority. |
serveit_root_ca.crt |
Public certificate for Root Certificate Aurthority. |
serveit.key |
Private key for server. |
serveit.crt |
Public certificate for server, signed with serveit_root_ca.key and serveit_root_ca.crt. |
Install serveit_root_ca.crt as a Trusted Root Certificate Authority in your
client device to have the browser trust the connection to serveit at
https://localhost:8080.
Create certificate for IP address:
serveit -tls -hosts 192.168.0.1Create certificate for domain name:
serveit -tls -hosts example.comCreate certificate for multiple domain names or IP addresses:
serveit -tls -hosts localhost,192.168.0.1,example.comServe on default HTTPS port (443):
serveit -tls -hosts example.com -port 443- Go
- GNU Make
- Text editor (Recommended: VSCode with Go extension)
make buildmake test