Custom opinionated hand-made server
| src | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| README.md | ||
Infoserv
If I'm going to make a website, I'm going to write all of it. This starts by the server. I will be cheating by using libraries, including the Zig standard libraries, if it involves crypto (like TLS) or sockets/networking.
Infoserv is short for Information Server. It's just a cool retro-scifi name for the project.
Build and run
You only need Zig to build and run:
zig build -Doptimize=ReleaseFast
# Start HTTP server on port 9080
./zig-out/bin/infoserv http
# Start HTTPS server on port 9443 (see below for more instructions)
./zig-out/bin/infoserv https
Run an HTTPS server
No support for ACME methods and whatnot. For testing, just make your own key/certificate pair:
# Make the key (ed25519)
openssl ecparam -out private/ca-key.pem -name prime256v1 -genkey
# Make the certificate
openssl req -new -x509 -days 3650 -extensions v3_ca -key private/ca-key.pem -out certs/ca-cert.pem
Otherwise, store your certificate in certs with the name ca-cert.pem, and your key in private with the name ca-key.pem