Adding title to config and utilizing it in layout

This commit is contained in:
2023-06-02 00:07:42 -04:00
parent effccfdbbc
commit f4da3f3ab3
6 changed files with 55 additions and 16 deletions

View File

@@ -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,
})
}
}