This commit introduces the foundational elements of the project: - `.gitignore` file to exclude build artifacts and environment variables. - `Cargo.lock` and `Cargo.toml` defining project dependencies and metadata. - `diesel.toml` for Diesel CLI configuration. - Initial migration files (`down.sql`, `up.sql`) for database schema setup. - `rustfmt.toml` for code formatting. - Basic module structure for database, routes, schema, state, and types. - `src/main.rs` with basic Axum server setup and dotenv loading. - `src/routes/system_router.rs` for basic API endpoint. - `src/state.rs` for managing application state and database connection pool. - Type definitions for Subsonic API responses and extensions.
18 lines
506 B
Rust
18 lines
506 B
Rust
use crate::state::AppState;
|
|
use crate::types::types::SubSonicResponses;
|
|
use axum::{Json, Router, http::StatusCode, routing::get};
|
|
|
|
pub fn system_routers() -> Router<AppState> {
|
|
Router::new().route(
|
|
"/getOpenSubsonicExtensions",
|
|
get(get_opensubsonic_extentions).post(get_opensubsonic_extentions),
|
|
)
|
|
}
|
|
|
|
async fn get_opensubsonic_extentions() -> (StatusCode, Json<SubSonicResponses>) {
|
|
(
|
|
StatusCode::OK,
|
|
Json(SubSonicResponses::open_subsonic_extentions()),
|
|
)
|
|
}
|