Deploy a Rust API
Build and deploy a Cargo binary as a Compute service.
Run your API locally and confirm it listens on 0.0.0.0. Use the same listening port when deploying. For example, from a Cargo binary package serving on port 8080:
ccp doctor --deps
rustup target add x86_64-unknown-linux-musl
ccp init . --port 8080
ccp compute deployCCP detects Cargo.toml, builds the Linux x86-64 executable and uploads it. The build host needs the linker and native dependencies required by your crate. If you already build the executable elsewhere, pass its path with --binary ./dist/api.
Request a known route at the URL printed by the command. Commit cluster.toml to share the build and service settings. CCP keeps the deployed service ID under .ccp/. On a fresh checkout, link the Compute service before deploying an update.