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

Resolves #371.
This commit is contained in:
Zac Pullar-Strecker 2018-10-06 17:09:10 +13:00 committed by Sergio Benitez
parent ea158d4344
commit 1c0f2d41a7
1 changed files with 17 additions and 0 deletions

View File

@ -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