mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
update dotenv::dotenv references
This commit is contained in:
@ -76,7 +76,7 @@ async fn add_user(
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
dotenv::dotenv().ok();
|
||||
dotenvy::dotenv().ok();
|
||||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||
|
||||
// initialize DB pool outside of `HttpServer::new` so that it is shared across all workers
|
||||
@ -118,7 +118,7 @@ mod tests {
|
||||
|
||||
#[actix_web::test]
|
||||
async fn user_routes() {
|
||||
dotenv::dotenv().ok();
|
||||
dotenvy::dotenv().ok();
|
||||
env_logger::try_init_from_env(env_logger::Env::new().default_filter_or("info")).ok();
|
||||
|
||||
let pool = initialize_db_pool();
|
||||
|
@ -24,7 +24,7 @@ fn get_conn_builder(
|
||||
#[actix_web::main]
|
||||
async fn main() -> io::Result<()> {
|
||||
// initialize environment
|
||||
dotenv::dotenv().ok();
|
||||
dotenvy::dotenv().ok();
|
||||
|
||||
// initialize logger
|
||||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||
|
@ -125,7 +125,7 @@ mod handlers {
|
||||
|
||||
use ::config::Config;
|
||||
use actix_web::{web, App, HttpServer};
|
||||
use dotenv::dotenv;
|
||||
use dotenvy::dotenv;
|
||||
use handlers::{add_user, get_users};
|
||||
use tokio_postgres::NoTls;
|
||||
|
||||
|
Reference in New Issue
Block a user