30 lines
677 B
Rust
30 lines
677 B
Rust
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
use std::sync::Arc;
|
|
|
|
use actix_web::web;
|
|
|
|
use crate::identity::adapters::types;
|
|
|
|
mod employee;
|
|
mod errors;
|
|
mod owner;
|
|
mod routes;
|
|
|
|
pub use errors::WebJsonRepsonse;
|
|
|
|
pub use routes::RoutesRepository;
|
|
|
|
pub fn load_ctx() -> impl FnOnce(&mut web::ServiceConfig) {
|
|
let routes = types::WebIdentityRoutesRepository::new(Arc::new(RoutesRepository::default()));
|
|
|
|
let f = move |cfg: &mut web::ServiceConfig| {
|
|
cfg.app_data(routes);
|
|
cfg.configure(owner::services);
|
|
cfg.configure(employee::services);
|
|
};
|
|
|
|
Box::new(f)
|
|
}
|