feat: plays radio stream from url

feat:  api structure
This commit is contained in:
Ahmet Kaan GÜMÜŞ 2024-03-07 04:07:11 +03:00
parent c908fdc097
commit 8f2b6f1e3f
17 changed files with 3534 additions and 0 deletions

20
back/src/routing.rs Normal file
View file

@ -0,0 +1,20 @@
use crate::AppState;
use axum::{extract::State, http::StatusCode, response::IntoResponse, routing::get, Json, Router};
use tower_http::cors::CorsLayer;
pub async fn routing(State(state): State<AppState>) -> Router{
Router::new()
.route("/", get(alive))
.layer(CorsLayer::permissive())
.with_state(state.clone())
}
async fn alive() -> impl IntoResponse{
let alive_json = serde_json::json!({
"status":"alive",
});
println!("Alive");
(StatusCode::OK, Json(alive_json))
}