20 lines
508 B
Rust
20 lines
508 B
Rust
mod api;
|
|
mod model;
|
|
|
|
pub use model::config;
|
|
|
|
use crate::model::config::SMTPConfig;
|
|
use axum::Router;
|
|
use tower_http::services::{ServeDir, ServeFile};
|
|
|
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
|
|
pub fn new(smtp_config: SMTPConfig) -> Router {
|
|
Router::new()
|
|
.nest("/api", api::new(smtp_config))
|
|
.fallback_service(
|
|
ServeDir::new("frontend/dist/frontend/browser")
|
|
.not_found_service(ServeFile::new("frontend/dist/frontend/browser/index.html")),
|
|
)
|
|
}
|