use axum::body::Body;
use axum::routing::get;
use axum::{Json, Router};
use etwin_core::core::Instant;
use serde_json::{json, Value as JsonValue};

pub fn router() -> Router<Body> {
  Router::new().route("/releases", get(get_releases))
}

async fn get_releases() -> Json<JsonValue> {
  Json(json!({
    "latest": {
      "version": "0.5.6",
      "time": Instant::ymd_hms(2021, 12, 18, 2, 20, 0),
    },
  }))
}
