22 lines
503 B
Rust
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>) {
|
|
}
|
|
|