vintage
Let's take it back to the 1990s. This library implements a multi-threaded server that speaks the FastCGI protocol.
Try it out!
Browsers don't speak FastCGI protocol. Thankfully, most popular web servers do. So to test locally, we'll have to have one such web server running. I'll be using Nginx & Caddy as examples. Pick one.
- Download either Nginx or Caddy
- Configure the web server to reverse proxy fastcgi:
-
If you picked caddy, stick this in a file in the current directory called
Caddyfile:localhost { reverse_proxy localhost:8000 { transport fastcgi } } -
If you picked nginx, stick this in a file in the current directory called
nginx.conf:events { } http { server { location / { fastcgi_pass localhost:8000; } } }
-
- Run the web server
- Caddy:
sudo caddy run --config Caddyfile - Nginx:
sudo nginx -p $(pwd) -c nginx.conf
- Caddy:
- Run
cargo new --bin app && cd app && cargo add vintage, and stick this inmain.rs:use start; - Run
cargo run - Visit
http://localhoston your browser!