removed static creds
This commit is contained in:
parent
74182f8ae1
commit
a43dabfa85
|
|
@ -5,7 +5,9 @@ use mongodb::{
|
||||||
Client, Collection, Database,
|
Client, Collection, Database,
|
||||||
};
|
};
|
||||||
pub async fn get_db_client() -> Result<Client> {
|
pub async fn get_db_client() -> Result<Client> {
|
||||||
Ok(Client::with_uri_str("mongodb://root:example@localhost:27017").await?)
|
let username = std::env::var("DB_USERNAME")?;
|
||||||
|
let password = std::env::var("DB_PASSWORD")?;
|
||||||
|
Ok(Client::with_uri_str(format!("mongodb://{username}:{password}@localhost:27017")).await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_database() -> Result<Database> {
|
pub async fn get_database() -> Result<Database> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue