Progress pring page fix and work? update
This commit is contained in:
11
src/main.rs
11
src/main.rs
@ -1,9 +1,11 @@
|
||||
use axum::{
|
||||
extract::{DefaultBodyLimit, Multipart, Path as AxumPath, State},
|
||||
http::StatusCode,
|
||||
response::IntoResponse,
|
||||
routing::{get, post},
|
||||
Json, Router,
|
||||
};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
@ -20,6 +22,14 @@ use tokio::fs;
|
||||
use tower_http::cors::CorsLayer;
|
||||
use tracing::{error, info, warn};
|
||||
|
||||
|
||||
async fn get_version() -> impl IntoResponse {
|
||||
Json(serde_json::json!({
|
||||
"version": "1.0.1",
|
||||
"timestamp": chrono::Utc::now().timestamp()
|
||||
}))
|
||||
}
|
||||
|
||||
// ─────────────────────────────── Модели ───────────────────────────────
|
||||
|
||||
#[derive(Deserialize, Clone, Debug)]
|
||||
@ -132,6 +142,7 @@ async fn main() {
|
||||
let cors = CorsLayer::permissive();
|
||||
|
||||
let app = Router::new()
|
||||
.route("/api/version", get(get_version))
|
||||
.route("/print", post(create_print))
|
||||
.route("/print/{job_id}", get(job_status))
|
||||
.route("/print/{job_id}/advance", post(job_advance))
|
||||
|
||||
Reference in New Issue
Block a user