pi-frame-server/src/api.rs
2024-07-24 09:43:09 -05:00

22 lines
503 B
Rust

use axum::{extract::State, http::StatusCode, routing::post, Router};
use crate::display::Wrapper;
use std::sync::{Arc, Mutex};
#[derive(Clone)]
struct ApiContext {
display: Arc<Mutex<Wrapper>>,
}
/// API routes for axum
/// Start with the basics: Send an image, crop it, dither, and upload.
/// we defer the upload to a separate task.
pub fn router() -> Router<ApiContext> {
Router::new()
.route("/setimage", post(set_image))
}
async fn set_image(State(ctx): State<ApiContext>) {
}