Rocket

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 1c0f2d41a705ea38fe7f7994b129461d4a4a6195
parent ea158d4344f7c8159b58f33f8172450df13703ca
Author: Zac Pullar-Strecker <zacps@users.noreply.github.com>
Date:   Sat,  6 Oct 2018 17:09:10 +1300

Explain 'rocket::custom()' in configuration guide.

Resolves #371.

Diffstat:
Msite/guide/configuration.md | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/site/guide/configuration.md b/site/guide/configuration.md @@ -237,6 +237,23 @@ ROCKET_ARRAY=[1,"b",3.14] ROCKET_DICT={key="abc",val=123} ``` +## rocket::custom + +Rocket can also be configured using `rocket::custom` and passing configuration options like so: + +```rust +use rocket::config::{Config, Environment}; + +let config = Config::build(Environment::Staging) + .address("1.2.3.4") + .port(9234) + .finalize()?; + +let app = rocket::custom(config, false); +``` + +If Rocket is launched through `rocket::custom` it will ignore `Rocket.toml` and any environment variables present, allowing you to use your own configuration loading code. + ## Configuring TLS Rocket includes built-in, native support for TLS >= 1.2 (Transport Layer