thesis/project/src/handlers/mod.rs
2020-04-09 11:52:31 +03:00

9 lines
304 B
Rust

pub mod authentication;
use crate::db_connection::{DbPool, MyPooledConnection};
use actix_web::{web, HttpResponse};
pub fn pool_handler(pool: web::Data<DbPool>) -> Result<MyPooledConnection, HttpResponse> {
pool.get()
.map_err(|e| HttpResponse::InternalServerError().json(e.to_string()))
}