feat: add a function to init properly app library
This commit is contained in:
@ -2,6 +2,20 @@ use anyhow::Error as AnyError;
|
||||
use axum::http::{StatusCode, Uri};
|
||||
use axum::response::{IntoResponse, Response};
|
||||
use axum::{routing::get, Router};
|
||||
use thiserror::Error;
|
||||
|
||||
use ::utils::config::{load_config, ConfigError};
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum InitError {
|
||||
#[error(transparent)]
|
||||
ConfigError(#[from] ConfigError),
|
||||
}
|
||||
|
||||
pub fn init() -> Result<(), InitError> {
|
||||
load_config(None)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_router() -> Router {
|
||||
Router::new()
|
||||
|
Reference in New Issue
Block a user