core: reexport loggers
This commit is contained in:
parent
38baa25561
commit
84589a1849
2 changed files with 7 additions and 2 deletions
|
@ -4,6 +4,8 @@ use actix_web::{HttpResponse, ResponseError};
|
|||
use serde::{Serialize, Serializer};
|
||||
use std::{fmt, io};
|
||||
|
||||
pub use log::{debug, error, info, trace, warn};
|
||||
|
||||
pub type Id = i32;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use actix_web::{get, web, App, HttpResponse, HttpServer, Responder};
|
||||
use log::*;
|
||||
use actix_web::{web, App, HttpResponse, HttpServer, Responder};
|
||||
use sqlx::postgres::PgPoolOptions;
|
||||
use sqlx::{migrate, query, PgPool, Pool};
|
||||
|
||||
|
@ -7,8 +6,10 @@ mod conf;
|
|||
mod core;
|
||||
mod data;
|
||||
mod model;
|
||||
mod repo;
|
||||
mod route;
|
||||
mod state;
|
||||
use crate::core::*;
|
||||
use conf::Config;
|
||||
use state::AppState;
|
||||
|
||||
|
@ -18,10 +19,12 @@ async fn main() -> std::io::Result<()> {
|
|||
pretty_env_logger::init();
|
||||
|
||||
let config = Config::from_env();
|
||||
info!("Establishing database connection");
|
||||
let db_pool = init_db(&config).await.unwrap();
|
||||
let bind_params = (config.bind_addr.clone(), config.bind_port.clone());
|
||||
let state = state::new(config, db_pool);
|
||||
|
||||
info!("Starting application");
|
||||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.app_data(state.clone())
|
||||
|
|
Loading…
Reference in a new issue