feat: Add initial project structure and dependencies
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.
This commit is contained in:
17
src/routes/system_router.rs
Normal file
17
src/routes/system_router.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
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()),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user