January 2019
Intermediate to advanced
520 pages
14h 32m
English
To run a microservice created with Rocket, you need to create a Rocket.toml configuration file. This allows you to configure a microservice before starting. Look at the following Rocket.toml contents:
[global]template_dir = "static"address = "127.0.0.1"port = 8003[global.databases.sqlite_database]url = "test.db"
In this configuration, we declared global parameters such as: the template_dir directory with templates (if we use it), address and port, and a url for a database connection.
You can override any parameter using environment variables. For example, if we need to set the port parameter to 80, we can run a microservice with a command:
ROCKET_PORT=3721 cargo run
The Rocket framework also supports three different ...
Read now
Unlock full access