feat: ✨ plays radio stream from url
feat: ✨ api structure
This commit is contained in:
parent
c908fdc097
commit
8f2b6f1e3f
17 changed files with 3534 additions and 0 deletions
20
back/src/routing.rs
Normal file
20
back/src/routing.rs
Normal 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))
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue