1
0
Fork 0

Use dotenv and method config::Config::from_env

This commit is contained in:
Alex Kotov 2020-10-15 08:44:51 +05:00
parent dd541a15b7
commit 3bf80af9cc
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
3 changed files with 10 additions and 1 deletions

7
Cargo.lock generated
View File

@ -337,6 +337,12 @@ dependencies = [
"generic-array 0.12.3",
]
[[package]]
name = "dotenv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "error-chain"
version = "0.12.4"
@ -359,6 +365,7 @@ version = "0.0.0"
dependencies = [
"bcrypt",
"diesel",
"dotenv",
"r2d2",
"regex",
"rocket",

View File

@ -14,6 +14,7 @@ publish = true
[dependencies]
bcrypt = "0.8.2"
dotenv = "0.15.0"
r2d2 = "0.8.9"
regex = "1.4.1"
rocket = "0.4.5"

View File

@ -17,6 +17,7 @@ mod forms;
extern crate rocket_contrib;
fn main() {
let config = config::Config::default().unwrap();
dotenv::dotenv().unwrap();
let config = config::Config::from_env().unwrap();
web::rocket(config).launch();
}