|
|
@@ -1,5 +1,11 @@
|
|
|
use actix_web::{HttpServer, web, App, middleware};
|
|
|
use actix_cors::Cors;
|
|
|
+use http_error::HttpError;
|
|
|
+use std::env;
|
|
|
+
|
|
|
+mod http_error;
|
|
|
+mod routes;
|
|
|
+mod controllers;
|
|
|
|
|
|
#[actix_web::main]
|
|
|
async fn main() -> std::io::Result<()> {
|
|
|
@@ -32,7 +38,7 @@ async fn main() -> std::io::Result<()> {
|
|
|
.wrap(cors)
|
|
|
.app_data(
|
|
|
web::JsonConfig::default().error_handler(|err, _req| {
|
|
|
- AppError::JsonDeserializationError(err.to_string()).into()
|
|
|
+ HttpError::JsonDeserializationError(err.to_string()).into()
|
|
|
})
|
|
|
)
|
|
|
.configure(routes::user::config)
|