2024-02-03 14:46:18 +01:00
|
|
|
mod files;
|
2024-01-30 19:27:14 +01:00
|
|
|
mod links;
|
|
|
|
|
2024-04-14 22:02:46 +02:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
2024-01-30 19:27:14 +01:00
|
|
|
use axum::Router;
|
|
|
|
use sqlx::PgPool;
|
|
|
|
|
2024-04-14 22:02:46 +02:00
|
|
|
use crate::config::Config;
|
|
|
|
|
|
|
|
pub fn router(db: PgPool, config: Arc<Config>) -> Router {
|
2024-02-03 14:46:18 +01:00
|
|
|
Router::new()
|
2024-04-14 22:02:46 +02:00
|
|
|
.nest("/files", files::router(db.clone(), config))
|
2024-02-03 14:46:18 +01:00
|
|
|
.nest("/links", links::router(db))
|
2024-01-30 19:27:14 +01:00
|
|
|
}
|