A quick demo of running an axum app as a CGI script
Find a file
2024-08-28 22:05:10 +05:30
src First (and only?) commit 2024-08-28 22:05:10 +05:30
.gitignore First (and only?) commit 2024-08-28 22:05:10 +05:30
Cargo.lock First (and only?) commit 2024-08-28 22:05:10 +05:30
Cargo.toml First (and only?) commit 2024-08-28 22:05:10 +05:30
LICENSE-APACHE First (and only?) commit 2024-08-28 22:05:10 +05:30
LICENSE-MIT First (and only?) commit 2024-08-28 22:05:10 +05:30
README.md First (and only?) commit 2024-08-28 22:05:10 +05:30

A quick demo of running an axum application as a CGI script!

This project uses the dumb_cgi crate to do its job, thereby proving that dumbness is sometimes good.

Usage

This project can be compiled normally, but it might be better to statically link it for greater compatiblity with more servers (not all CGI servers are running the latest hardware, after all):

RUSTFLAGS='-C target-feature=+crt-static' cargo build --release

Due to problems with statically linking some libraries, you might have to manually specify the platform for x86_64-unknown-linux-gnu if that's what you're building for:

RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target x86_64-unknown-linux-gnu

After this, copy the resulting target/release/axumcgi file to cgi-bin on your server and start using it!

(Note: you may have to rename the binary to something like axumcgi.cgi or less redundantly axum.cgi to make it work)

License

This project is licensed under either of

at your option.