Documentation
Rust Module
Our Rust module works with the usual Rust setup: it expects a Cargo.toml file in your project's directory (that you provide as the "Source Directory" option). Importantly, it also requires a Cargo.lock, so be sure to lock your depenedencies!
garnix will then:
- Install your dependencies. Each dependency will only be built once: after that, it will be cached, making future builds faster.
- Build your project
- Run your tests
- Run clippy, rustfmt, and cargo-doc on your project as part of CI.
If additionally your project has a web server, and you want to deploy it, that's a breeze. Just enable the "Web Server" option of the Rust module. Then, what command to use to start the server, what port your application listens on, and what API path to serve the application on. The latter is useful if you're deploying multiple servers (e.g., a frontend and a backend), and want to route between them.
Once deployed your server will be available on a URL based on your branch name, or directly via IP address. You can see your running servers in your servers tab. See also the custom domains section of our docs for how to use custom domains with your deployment.
Remember that you can combine modules, so if you have a Rust web server, you might want to look at the User module so you can SSH into your server, the NodeJS module so you can have a JavaScript or TypeScript frontend, and the PostgreSQL module for a database.