Refactored the whole code to a better structure

This commit is contained in:
Marko Korhonen 2020-04-05 22:53:42 +03:00
parent 87cc8ac794
commit 12b865bf17
No known key found for this signature in database
GPG key ID: 911B85FBC6003FE5
21 changed files with 473 additions and 257 deletions

View 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()))
}