Refactored the whole code to a better structure
This commit is contained in:
parent
87cc8ac794
commit
12b865bf17
21 changed files with 473 additions and 257 deletions
10
project/src/handlers/mod.rs
Normal file
10
project/src/handlers/mod.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
pub mod authentication;
|
||||
pub mod register;
|
||||
|
||||
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()))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue