A basic scaffolding to create new API projects or workers with Rust.
- Monorepo: is a software development strategy where code for many projects is stored in the same repository. Check this reference;
- Workspace (rust/cargo): is a collection of one or more packages, called workspace members, that are managed together. Check this reference;
-
Open the project in VSCode;
-
Select the option
Reopen in Container
to open the project in a container; -
Open the terminal in the VSCode;
-
Run the command
cargo run --bin <package-name>
in the terminal.cargo run --bin hello_world cargo run --bin quotes
you can create an alias in the
Makefile
to run the command above.
-
In the terminal, open the
crates
folder; -
Run the command below:
cargo new <package-name> --bin
If you want to create a library package, just change the
--bin
flag to--lib
.