Configuring our Rocket web application
Let's learn how to configure our Rocket web application, starting with different profiles for different situations. Then, we will use the Rocket.toml
file to configure it. And finally, we will learn how to use environment variables to configure our application.
Starting the Rocket application in different profiles
Let's run our synchronous application server without a release flag, and in another terminal, let's see whether we can benchmark it:
- First, let's install the application using
cargo install benchrs
. That's right, you can install the application using Cargo too! There are very good Rust programs that you can use in your terminal, for example,ripgrep
, which is one of the fastest applications for grepping string in your code.
If you want to call the Cargo-installed application, you can use the full path or add it to your terminal path if you are using a Unix-based terminal. Append the following...