Adding title to config and utilizing it in layout
This commit is contained in:
@@ -6,6 +6,7 @@ pub struct Config {
|
||||
pub database_max_connections: u32,
|
||||
pub host: String,
|
||||
pub port: u16,
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
@@ -14,12 +15,14 @@ impl Config {
|
||||
let database_max_connections = std::env::var("DATABASE_MAX_CONNECTIONS").context("DATABASE_MAX_CONNECTIONS not set")?.parse()?;
|
||||
let host = std::env::var("HOST").context("HOST not set")?;
|
||||
let port = std::env::var("PORT").context("PORT not set")?.parse()?;
|
||||
let title = std::env::var("TITLE").context("TITLE not set")?;
|
||||
|
||||
Ok(Config {
|
||||
database_url,
|
||||
database_max_connections,
|
||||
host,
|
||||
port,
|
||||
title,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user