Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.4 kB · 35 lines
Rust
at dev
123456789101112131415161718192021222324252627282930313233343536//! HTTP surface (docs/07): plain axum + HTMX fragment swaps, every state a URL.
pub mod auth;pub mod pages;pub mod session;pub mod sky;
use axum::routing::{get, post};use axum::Router;
use crate::state::SharedState;
pub fn router(state: SharedState) -> Router { Router::new() .route("/", get(pages::landing)) .route("/client-metadata.json", get(auth::client_metadata_json)) .route("/oauth/login", post(auth::login)) .route("/oauth/callback", get(auth::callback)) .route("/oauth/logout", post(auth::logout)) .route("/session", get(session::session_page)) .route("/session/next", get(session::next_fragment)) .route("/session/complete", post(session::complete)) .route("/session/resonate", post(session::resonate)) .route("/sky/{handle}", get(sky::sky_page)) .route("/sky/{handle}/term/{term}", get(sky::term_fragment)) .route("/sky/{handle}/card.png", get(sky::card_png)) .route("/compare/{a}/{b}", get(sky::compare_page)) .route("/atlas", get(sky::atlas_page)) .route("/export", get(sky::export_json)) .route("/snapshot", post(sky::publish_snapshot)) .route("/pair/{handle}", post(sky::request_pairing)) .route("/pair/{handle}/accept", post(sky::accept_pairing)) .route("/static/sky.js", get(pages::sky_js)) .with_state(state)}