🏡 index : ~doyle/blocks.ls.git

author Jordan Doyle <jordan@doyle.la> 2022-12-10 15:50:46.0 +00:00:00
committer Jordan Doyle <jordan@doyle.la> 2022-12-10 15:50:46.0 +00:00:00
commit
a0e64ad96ccbaf26f2132579fc866b6e2f089c17 [patch]
tree
47b4b861d30f0bf3496cb6d01a8fa0568dc81709
parent
52b32bda02023473ee5b411e132ed54eb1f3a86b
download
a0e64ad96ccbaf26f2132579fc866b6e2f089c17.tar.gz

Allow setting db port



Diff

 web-api/Cargo.toml          | 2 +-
 web-api/src/config.rs       | 1 +
 web-api/src/database/mod.rs | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/web-api/Cargo.toml b/web-api/Cargo.toml
index 0c49e13..895126d 100644
--- a/web-api/Cargo.toml
+++ b/web-api/Cargo.toml
@@ -19,6 +19,6 @@ tower = "0.4"
tracing = "0.1"
tracing-subscriber = "0.3"
toml = "0.5"
tokio = { version = "1.18", features = ["macros"] }
tokio = { version = "1.18", features = ["full"] }
tokio-postgres = { version = "0.7", features = ["with-chrono-0_4", "with-serde_json-1"] }
uuid = { version = "1.0", features = ["v4"] }
diff --git a/web-api/src/config.rs b/web-api/src/config.rs
index 7106d75..03cec06 100644
--- a/web-api/src/config.rs
+++ b/web-api/src/config.rs
@@ -20,5 +20,6 @@ pub struct DatabaseConfig {
    pub user: String,
    pub password: String,
    pub host: String,
    pub port: u16,
    pub database: String,
}
diff --git a/web-api/src/database/mod.rs b/web-api/src/database/mod.rs
index fd001eb..91c4899 100644
--- a/web-api/src/database/mod.rs
+++ b/web-api/src/database/mod.rs
@@ -28,6 +28,7 @@ impl From<DatabaseConfig> for Config {
        c.user = Some(config.user);
        c.password = Some(config.password);
        c.host = Some(config.host);
        c.port = Some(config.port);
        c.dbname = Some(config.database);
        c.manager = Some(ManagerConfig {
            recycling_method: RecyclingMethod::Verified,